Write a program to determine whether the input character is a vowel or consonant. Input and Output Format: Input consists of a single character. Output consists of a string --- “Vowel†/ “Consonant†/ “Not an alphabet†Refer sample input and output for formatting specifications. All text in bold corresponds to input and the rest corresponds to output. Sample Input and Output 1: Enter a character a Vowel Sample Input and Output 2: Enter a character Z Consonant Sample Input and Output 3: Enter a character # Not an alphabet
#include<stdio.h> int main(){ char in; char arr[11]={'a','e','i','o','u','A','E','O','U','I'}; int i,flag=0,con=0; scanf("%c",&in); if(((in>='a') && (in<='z'))||((in>='A')&&(in<='Z'))) { for(i=0;i<10;i++) { if(in==arr[i]){ flag++; break; } else con++; } } else printf("Not an alphabet\n"); if(con) printf("Consonant"); if(flag) printf("Vowel"); return 0; }