Tuesday, 10 January 2012

c program to check whether input alphabet is a vowel or not

This code checks whether an input alphabet is a vowel or not. Both lower-case and upper-case are checked.


void main()
    char ch;
    printf("Enter a character\n");
    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);
    printf("%c is not a vowel.\n", ch);


check charater case output

1 comment:

  1. hey hi... i am using code::blocks10.05 as a compiler. when i am writing this programme it shows an error saying "expected identifier or '(' before '{' token". please suggest what to do.