C program to check whether input alphabet is a vowel or not
Posted by Spider on 12:23 AM
#include <stdio.h> int main() { char ch; printf("Enter a character : "); scanf("%c", &ch); if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch == 'u' || ch == 'U') printf("%c is a vowel.\n", ch); else printf("%c is not a vowel.\n", ch); return 0; }
/*
Output : #1
Enter a character : AA is a vowel
Output : #2
Enter a character : xx is not a vowel
*/
Tags
C Basics