• Now Online : 29
  • admin@codemyne.net

Introduction

Program shows that the alphabet is vowel or not. Switch case is used in this program. If any character is entered by user the program tells that number is vowel or consonent, and it gives output.

#include<stdio.h>
main()
{
    char ch;
    clrcsr();
    printf("/n Enter a alphabet in lower case(a-z):");
    scanf("%c",&ch);
    if(ch < 'a'|| ch > 'z')
    {
        printf("/n chracter is not a alphabet in lower case");
    }
    else
    {
        switch(ch)
        {
            case 'a':
            case 'e':
            case 'i':
            case 'o':
            case 'u':
            printf("/n character is a vowel");
            bresk;
            case 'z':
            printf("/n last alphabet was entered");
            break;
            default:
            printf("/n character is consonent");
            break;                    
        }
    }
}

Comments/Suggestions are invited. Happy coding......!

Comments Post a Comment