Write a program to enter a character and then determine whether it is a vowel or not.


#include<stdio.h>
#include<conio.h>
void main()
{
char ch;
clrscr();
printf("\n 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 %c is a vowel", ch);
}
else
{
printf("\n %c is not a vowel");
}
getch();
}


Output


Enter any character: v
v is not a vowel

Comments