Source Code to Check Whether a Character is Vowel or consonant
#include <stdio.h>
int main(){
char c;
printf("Enter an alphabet: ");
scanf("%c",&c);
if(c=='a'||c=='A'||c=='e'||c=='E'||c=='i'||c=='I'||c=='o'||c=='O'||c=='u'||c=='U')
printf("%c is a vowel.",c);
else
printf("%c is a consonant.",c);
return 0;
}
Output 1
Enter an alphabet: i
i is a vowel.
0 comments:
Post a Comment