Accept a character from the user and check whether the character is a vowel or consonant. (Hint: a,e,i,o,u,A,E,I,O,U are vowels).


#include <stdio.h>

int main()
{
    char ch;

    printf("Please Enter an alphabet: \n");
    scanf(" %c", &ch);
    
    if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' ||
  ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')  {
  printf("\n %c is a VOWEL.", ch);
 }
    else {
     printf("\n %c is a CONSONANT.", ch);
 }
    return 0;
}
Accept a character from the user and check whether the character is a vowel or consonant. (Hint: a,e,i,o,u,A,E,I,O,U are vowels). Accept a character from the user and check whether the character is a vowel or consonant. (Hint: a,e,i,o,u,A,E,I,O,U are vowels). Reviewed by on August 30, 2019 Rating: 5
Powered by Blogger.