C Program to Check Whether a Character is Vowel or Consonant

#include<stdio.h>
#include<ctype.h>
int main()
{
   char ch1,ch;
   printf("Enter a character\n");
   scanf("%c",&ch1);
   ch=tolower(ch1);
   if(ch=='a' || ch=='e'||ch=='u' || ch=='o'||ch=='u')
    printf("%c is a vowel\n",ch1);
   else
    printf("%c is a consonant\n",ch1);
  return 0;
}

Output:
C Program to Check Whether a Character is Vowel or Consonant


Comments