Saturday, March 19, 2016

Vowel or Not By C programming using switch case

//Determine a character vowel or consonant ...This is Documentation Section
#include<stdio.h>//Link section
#include<conio.h>//Link section

int main()//main function starts
{

    char ch;//local declaration
    printf("Enter a character: ");//show a message to user
    ch=getche();//input for character
    switch(ch)
    {
        case 'a':
        case 'e':
        case 'i':
        case 'o':
        case 'u':
        {
            printf(" is vowel");
        break;
        }
        default:
        {
            printf(" is consonant");
            break;
        }


    }

    return 0;
}//main function ends

No comments:

Post a Comment