C program to check whether input alphabet is a vowel or not using function
#include <stdio.h>
int main()
{
char ch;
int flg;
printf("Input a character : ");
scanf("%c",&ch);
flg=check_vowel(ch);
if(flg==1)
printf("%c is a vowel",ch);
else
printf("%c is not a vowel",ch);
return 0;
}
int check_vowel(char a)
{
if (a=='a'|| a == 'e'|| a == 'i'|| a == 'o'|| a == 'u'||a=='A'|| a == 'E'|| a == 'I'|| a == 'O'|| a == 'U')
return 1;
return 0;
}
/*
Output : #1
Input a character :A
A is a vowel
Output : #2
Input a character :x
x is not a vowel
*/