Check If Alphabet is Vowel - Devbhoomi

FREE JOB ALERT & ONLINE TUTORIALS

Hot

Post Top Ad

Tuesday 7 November 2017

Check If Alphabet is Vowel

#include <stdio.h>

int main()
{

    char ch;

    printf("Enter a character\n");
    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
Enter a character
a
a is a vowel.

No comments:

Post a Comment

Post Top Ad