Prerequisite:
Vowel and Consonant: a,e, i,o,u or A, E, I, O, U are Vowels and other alphabets are consonant.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
#include<stdio.h> int main() { unsigned char ch; printf("\n Program to check Whether Vowel or Consonant"); printf("\nPlease enter any Alphabets: "); scanf("%c",&ch); if((ch=='a')||(ch=='e')||(ch=='i')||(ch=='o')||(ch=='u')) { printf("\n %c is Vowel",ch); } else if((ch=='A')||(ch=='E')||(ch=='I')||(ch=='O')||(ch=='U')) { printf("\n %c is Vowel",ch); } else { printf("\n %c is Consonant",ch); } return 0; } |
1 2 3 4 5 |
Output: Program to check Whether Vowel or Consonant Please enter any Alphabets: c c is Consonant |