Tuesday, May 7, 2013

Cheak whether a given charrector is vowel or consonants in c

\\Source Code

#include<stdio.h>
#include<conio.h>
void main()
{
  char p;
  clrscr();
  printf("\n enter a alphabet:");
  p=getchar();
  if(isalpha(p)!=0)
   {
     switch(tolower(p))
      {
        Case 'a';
        case 'e';
        case 'i';
        case 'o';
        case 'u';
        printf("it is a vowel");
        break;
         default:
         printf("it is a consonant");

        }
      } 

 getch();
}

No comments:

Post a Comment