To check the given character is vowel
(or) not
Program:
#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();
}
Output:
Case: 1
Enter the character : u
u is a vowel
Case: 2
Enter the character : v
v is not a vowel
-
UpdatedDec 31, 2019
-
Views5,243
You May Like
Program to maintain employee details using structures
Program to maintain student details using structures
Check whether the person is eligible to vote or not
Print the numbers that are divisible by a given no.
Program to generate magic square
To sort the given numbers in ascending & descending order