C program to Input any Alphabet and Check Whether it is Vowel or Consonant ?
Q:- Write a C program to Input any Alphabet and Check Whether it is
Vowel or
Consonant ?
Input
#include<stdio.h>
#include<conio.h>
int
main()
{
char ch;
clrscr();
printf(“Enter a Character =”);
scanf(“%c”,&ch);
if(ch==’a’||ch==’e’||ch==’i’||ch==’o’||ch==’u’||ch==’A’||ch==’E’||ch==’I’
||ch==’O’||ch==’U’)
{
printf(“%c is Vowel.”,ch);
}
else
{
printf(“%c is Consonant.”,ch);
}
getch();
}
Output
Enter a
Character = D
D is
Consonant.
Comments
Post a Comment