Tuesday, 17 March 2015

To check the given character is vowel or not Using C

# include <stdio.h>
# include <conio.h>

void main()
{
char c ;
clrscr() ;
printf("Enter the character : ") ;
scanf("%c", &c) ;
if( c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u' ||
c == 'A' || c == 'E' || c == 'I' || c == 'O' || c == 'U')
printf("\n%c is a vowel", c) ;
else
printf("\n%c is not a vowel", c) ;
getch() ;
}

RUN 1 :
~~~~~~~
Enter the character : u
u is a vowel
RUN 2 :
~~~~~~~
Enter the character : v
v is not a vowel

No comments:

Post a Comment