Powered by Blogger.

Tuesday, March 19, 2013

17.Test vowel and consonant by using switch statement:

#include<stdio.h>
 int main()
{
    char ch;
    printf("\n Enter a character:");
    scanf("%c",&ch);
    switch(ch)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        printf("\n your choice is vowel.\n");
        break;
        default:
        printf("\n your choice is not a vowel.\n");
        break;
    }
       return 0;
}

0 comments:

Post a Comment