Вы находитесь на странице: 1из 2

www.eazynotes.

com

Gursharan Singh Tatla

Page No. 1

/*
Program to Check Whether a Character is a Vowel or not by using
switch Statement
*/

#include <stdio.h>

main()
{
char ch;

printf("\nEnter any character: ");


scanf("%c", &ch);

switch (ch)
{
case 'a':
case 'A':
printf("\n\n%c is a vowel", ch);
break;
case 'e':
case 'E':
printf("\n\n%c is a vowel", ch);
break;
case 'i':
case 'I':
printf("\n\n%c is a vowel", ch);
break;

www.eazynotes.com

Gursharan Singh Tatla

case 'o':
case 'O':
printf("\n\n%c is a vowel", ch);
break;
case 'u':
case 'U':
printf("\n\n%c is a vowel", ch);
break;
default:
printf("\n\n%c is not a vowel", ch);
}

getch();
}

Page No. 2

Вам также может понравиться