Filled Under: ,

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

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

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


In this program, I have discussed about the C program to check whether a character is a vowel or consonant.

#include<stdio.h>
int main()
{ char a;

printf("Enter an alphabet:");
scanf("%c",&a);
switch(a)
{
case 'a': printf("Vowel");
break;
case 'e': printf("Vowel");
break;
case 'i': printf("Vowel");
break;
case 'o': printf("Vowel");
break;
case 'u': printf("Vowel");
break;
case 'A': printf("Vowel");
break;
case 'E': printf("Vowel");
break;
case 'O': printf("Vowel");
break;
case 'I': printf("Vowel");
break;
case 'U': printf("Vowel");
break;
default: printf("Consonant");
}
}

Just copy and paste the program in your desired compiler (Dev C++ is more preferable) and run it.

Enjoy programming in C.

0 comments:

Post a Comment

 

Copyright 2020 Programming in C All Right Reserved