Write a C program to input any alphabet and check whether it is vowel or consonant.

 There are 5 vowel in the English they are (a,e,i,o,u) or (A,E,I,O,U).So we check that if letter is matched with these then it is vowel otherwise it is consonant.

 code:-

//program to check a alphabet vowel or consonant//
#include<stdio.h>
int main()
{
char c;
printf(“Enter a alphabet”);
scanf(“%c”,&c);
if(c==‘a’ || c==‘i’||c==‘e’||c==‘o’||c==‘u’||c==‘A’||c==‘E’||c==‘I’||c==‘O’||c==‘U’)
{
printf(“alphabet is vowel”);
}
else
printf(“alphabet is consonant”);
return 0;
}

Output:-

Enter a alphabet
a
alphabet is vowel

Video solution:-




Recommended Post:

Hackerearth Problems:-

Hackerrank Problems:-

Data structure:-

Key points:-

 MCQs:-

Leave a Reply

Your email address will not be published.