Vowel or Consonant Program in C

The Vowel or Consonant Program in C program checks the input character is either Vowel or Consonant.
In this program, we are checking lower case vowels directly and upper case characters using
their ASCII values.


#include<stdio.h>
void main()
{
char ch;
printf(“Enter Character : “);
scanf(“%c”,&ch);
if((ch==’a’)||(ch==’e’)||(ch==’i’)||(ch==’o’)||(ch==’u’))
{
printf(“Character ‘%c’ is a Vowel”,ch);
}
else
{
printf(“Character ‘%c’ is a Consonant”,ch);
}
}

Share this