Showing posts with label consonant. Show all posts
Showing posts with label consonant. Show all posts

Wednesday, May 16, 2018

C program to find whether the given alphabet is a vowel or consonant.

Program code
#include <stdio.h>
#include <conio.h>
void main()
{
char letter;
clrscr();
printf("Please input an alphabet.\n");
scanf("%c",&letter);
if ((letter=='a')||(letter=='e')||(letter=='i')||(letter=='o')||(letter=='u'))
printf("This alphabet is a vowel.\n");
else
printf("This alphabet is a consonant.\n");
getch();
}

Example of output
Please input an alphabet.
n
This alphabet is a consonant.