write a program to character is vowel or not using switch statement.

 

#include<stdio.h>

#include<conio.h>

void main()

{

char c ;

printf(“enter the alphabet: \n”);

scanf(“%c”, &c);

switch(c)

{

case ‘a':

case ‘A':

printf(“vowel”);

break;

case ‘e':

case ‘E':

printf(“vowel”);

break;

case ‘i':

case ‘I':

printf(“vowel”);

break;

case ‘o':

case ‘O':

printf(“vowel”);

break;

case ‘u':

case ‘U':

printf(“vowel”);

break;

default:

printf(“not vovel:”);

}

getch();

}

 

< Another Method >

 

 

#include<stdio.h>

#include<conio.h>

void main()

{

char c;

printf(“enter the alphabet: \n”);

scanf(“%c”, &c);

switch(c)

{

case ‘a':

case ‘A':

case ‘e':

case ‘E':

case ‘i':

case ‘I':

case ‘o':

case ‘O':

case ‘u':

case ‘U':

printf(“vovel”);

break;

default:

printf(“no vovel: “);

}

getch();

}