// C program
#include<stdio.h>
void main()
{
char ch;
clrscr();
printf("Enter any character:");
scanf("%c",&ch);
switch(ch)
{
case 'a' || 'A':
case 'e' || 'E':
case 'i' || 'I':
case 'o' || 'O':
case 'u' || 'U':
printf("The character is a vowel");
break;
default: printf("The character is not vowel");
break;
}
getch();
}
Sample Input/Output:
Enter any character: A
The character is a vowel
#include<stdio.h>
void main()
{
char ch;
clrscr();
printf("Enter any character:");
scanf("%c",&ch);
switch(ch)
{
case 'a' || 'A':
case 'e' || 'E':
case 'i' || 'I':
case 'o' || 'O':
case 'u' || 'U':
printf("The character is a vowel");
break;
default: printf("The character is not vowel");
break;
}
getch();
}
Sample Input/Output:
Enter any character: A
The character is a vowel
No comments:
Post a Comment