Friday, 26 August 2016

Check Vowel or consonant

Check Vowel or consonant:

#include <stdio.h>
int main()
{
    char c
    int n1,n2;
    printf("Enter any alphabet: ");
    scanf("%c",&c);
     n1= (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u');
     n2 = (c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U');
     if (n1 || n2)
        printf("%c is a vowel.",c);
    else
        printf("%c is a consonant.",c);
    return 0;

}

0 comments:

Post a Comment

if you have any doubt please let me know