Write a C program that can read a character and check it is vowel or consonant.

First open CodeBlocks and create a file.Then save the file named test.cpp.Then write the following simple C code.Finally Run the Code.

In English alphabet a,e,i,o & u are vowel and rest are consonant.


#include<stdio.h>
int main()
{
char ch;
printf("Enter any Letter:");
scanf("%c",&ch);

if(ch == "A" || ch == "a" || ch == "E" || ch == "e" || ch == "I" || ch == "i" || ch == "O" || ch == "o" || ch == "U" || ch == "u")
{
printf("This is Vowel.");
}
else
{
printf("This is Consonant.");
}

return 0;
}

Output: