C LANGUAGE - TO CHECK GIVEN CHARACTER IS VOWEL OR NOT?
on
Get link
Facebook
X
Pinterest
Email
Other Apps
// check whether the given character is Vowel or not
#include <stdio.h>
#include <conio.h>
int main()
{
char ch;
clrscr();
printf( " Enter any Character : " );
scanf( "%c", &ch );
if( ( ch == 'a' ) || ( ch == 'e' ) || ( ch == 'i' ) ||
( ch == 'o' ) || ( ch == 'u' ) || ( ch == 'A' ) ||
( ch == 'E' ) || ( ch == 'I' ) || ( ch == 'O' ) ||
( ch == 'U' ) )
{
printf( "\n Character is a Vowel." );
}
else
{
printf( "\n Character is not a Vowel." );
}
getch();
return 0;
}
Note: Click on copy button to copy the given code and you can paste it in any online compiler to see the result, IF YOU ARE A MOBILE USER THEN DOWNLOAD "CODING C"(Free App) COMPILER FROM GOOGLE PLAY STORE.