Program to check the
given value is vowel
Program
#include<stdio.h>
void main()
{
int flag = 0;
int ceckvowel(void);
printf("\nIn
Main Control.\n Check Vowel.\n");
do
{
if(checkvowel() == 1)
{
printf("\nThe
Given Character is a Vowel.");
flag = 1;
}
else
{
printf("\nTry
Again...");
flag = 0;
}
}while(flag == 0);
}
int checkvowel(void)
{
char ch;
printf("\nEnter
Any Character : ");
ch = getche();
if(ch == 'a' || ch ==
'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' ||
ch == 'I' || ch =='O'
|| ch =='U')
return 1;
else
return 0;
}
No comments:
Post a Comment