Thursday 23 January 2014

C program to check whether input alphabet is a vowel or not

in this c program we will find where alphabet is vowel or not using switch statement 


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

}

No comments:

Post a Comment