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:
#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