What is Vowel?
The characters such as ‘a’, ‘e’, ‘i’, ‘o’, ‘u’ are called vowels.
C program to find whether given character is a Vowel or not:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
#include <stdio.h> int main() { char c; printf("Please enter a character\n"); scanf("%c", &c); if (c == 'a' || c == 'A' || c == 'e' || c == 'E' || c == 'i' || c == 'I' || c =='o' || c=='O' || c == 'u' || c == 'U') printf("\nThe entered character %c is a vowel.\n", c); else printf("\nThe entered character %c is not a vowel.\n", c); return 0; } |
Output:
Please enter a character
a
The entered character a is a vowel.