Check vowel character

Program:

#include<stdio.h>
int main()
{
char ch;
printf("Enter one character: ");
scanf("%c",&ch);
if(((ch>='a') && (ch<='z')) || ((ch>='A') && (ch<='Z')))
{
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",ch);
       break;
default  :
   printf("%c is not vowel",ch);   
}
}
else
{
printf("%c is not alphabet",ch);
}
return 0;

}

Output:






No comments:

Post a Comment

x^y using recursion

Program: #include<stdio.h> int power(int a,int b); int main() { int x,y,ans; printf("Enter x and y:\n "); scanf(...