Check Whether a Character is Vowel or consonant
Source Code:-
#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.
Output 2
Enter an alphabet: G G is a consonant.
0 comments:
Post a Comment