In this C-program we will check that, if an alphabet is vowel or consonant. The alphabet will be taken from the user.color>
input:
The alphabet(i.e : A,b,p etc.)output:
The alphabet is vowel or consonantCODE---->
#include
#include
{
char ch;
printf("Enter an alphabet:-color>");
scanf("%ccolor>",&ch);
if(ch=='A'||ch=='a'||ch=='E'||ch=='e'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U'color>)
{
printf("%c is a vowelcolor>",ch);
}
else
{
printf("%c is consonantcolor>",ch);
}
getch();
}
Note:color>***There is no space or a gap of line between ifcolor> and it's condition [i.e:(ch=='A'||ch=='a'||ch=='E'||ch=='e'||ch=='i'||ch=='I'||ch=='o'||ch=='O'||ch=='u'||ch=='U'color>)]***
color>