Program in C to check a given character is vowel or consonant Using if else statement
#include<stdio.h> int main() { char ch; printf("Enter a character:-"); ch=getchar(); if((ch=='A'||ch=='a')||(ch=='E'||ch=='e')||(ch=='I'||ch=='i')||(ch=='O'||ch=='o')||(ch=='U'||ch=='u')) printf("%c is vowel.",ch); else printf("%c is consonant.",ch); return 0; }
Output:-
Related program :
0 Comments