Find Whether The Character Is Vowel Or Consonant From User Input.
This is a very cool programme and too much easy programme with us. Go and Do it With fun.
Input : Any Vowel (a,e,i,o,u)
Code:
#include<stdio.h>
int main()
{
char a,e,i,o,u,ch;
printf(" Enter the Character for check: ");
scanf("%c", &ch);
if(ch=='a')
{
printf(" Inputed Character is VOWEL");
}
else if (ch=='e')
{
printf(" Inputed Character is VOWEL");
}
else if (ch=='i')
{
printf(" Inputed Character is VOWEL");
}
else if (ch=='o')
{
printf(" Inputed Character is VOWEL");
}
else if (ch =='u')
{
printf(" Inputed Character is VOWEL");
}
else
{
printf(" Inputed Character is CONSONANT");
}
system("color B0");
return 0;
}
Code Details:
We need to take some character as initializatin of programme. Ex: char a,e,i,o,u,ch; . Then we need to scan a character from user then we need to assign the value in “” scanf(“%c”, &ch); “”. We need to use “for loop” here for check the inputed user character. in ‘for loop’ we used ( ch==’a’ ) this to check the user input if it’s vowel or consonant. Here ( ch==’a’ ) we are checking that either value-‘a’ is in variable-‘ch’ or not.
OutPut/Console :

Need To Know: