C language Programme to Check Whether a Character is a Vowel or Consonant
1. C is an imperative, procedural programming language. It has been around since the 1960s. It was originally designed as a teaching tool for students learning computer science.
2. A C program is a series of instructions written in the C programming language. These instructions tell the computer what to do.
3. In this article we’ll teach you how to write a C program to check whether a character is a vowel or consonant.
------------------------------------------
#include<stdio.h>
#include<conio.h>
void main()
{ clrscr();
char x. lowercase, uppercase;
pritnf("enter an alphabet : ");
scanf("%c",&x);
lowercase = (x=='a' || x=='e'||x=='i'||x=='o'||x=='u');
uppercase = (x=='A'||x=='E'||x=='I'||x=='O'||x=='U');
if(lowercase||uppercase)
{
printf("%c is a vowel");
}
else
printf(" %c is consonent");
getch();}
--------------------------------------------
Comments
Post a Comment