C program to check whether enter alphabet is vowel or not.

Posted by Mangesh on March 21, 2018

/* Program in C to check whether enter alphabet is vowel or not. */

Description :

The letters A, E, I, O, and U are called vowels. The other letters in the alphabet are called consonants. So we need to check whether the enter character consists of any of this character.

Logic :

We can first match the enter character with upper case vowels and then match it with lower case vowels. and finally print the result.

Program :

#include<stdio.h>
#include<conio.h>
void main()
{
char letter;
printf("Enter the letter :");
scanf("%c",&letter);
if(letter == 'a' || letter =='e' || letter == 'i' || letter == 'o' || letter == 'u')
  printf("%c is vowel",letter);
else if(letter == 'A' || letter =='E' || letter == 'I' || letter == 'O' || letter == 'U')
  printf("%c is vowel",letter);
else
  printf("%c is not a vowel",letter);
getch();
}

Output :

C program for vowel executed and tested in Turbo C 3.2

Skills learned:

Basic If-Else statements.

Written with from Mangesh.

Related Post
1 C program to check number is even or odd.
2 C program to swap to number.
3 C program to check whether the year is leap year or not.
4 C program to check whether enter alphabet is vowel or not.
Latest Post
1 C program to implement Queue using linked list.
2 C program for binary search tree (BST).
3 C program to search an element in linked list.
4 C program for postorder traversal in binary tree.
5 C program for preorder traversal in binary tree.