Sunday 16 April 2017

Write a program to check whether character is vowel or consonant

Program to check whether character is vowel or consonant


#include<stdio.h>
void main()
{
             char ch;
             printf("\nEnter the character:");
             scanf("%c", &ch);
             switch(ch)
            {
                      case 'a':
                      case 'e':
                      case 'i':
                      case 'o':
                      case 'u':    printf("\nGiven character is vowel");
                                       break;
                      default:     printf("\nGiven character is consonant");
                                       break;
           }
}

Output:
Enter the character: o
Given character is vowel

Enter the character: t
Given character is consonant

No comments:

Post a Comment