Write a C Program to check vowel or consonant

#include <stdio.h>
/* Program to check vowel or consonant

Note: The alphabets a,e,i,o,u are vowels and
rest are consonants */
void main()
{
char ch=’A’;
int temp=0;
switch(ch)
{
case ‘a’:
case ‘A’:
case ‘e’:
case ‘E’:
case ‘i’:
case ‘I’:
case ‘o’:
case ‘O’:
case ‘u’:
case ‘U’:
temp=0;
break;
default:
temp=1;
}
if(temp==0){
printf(“It is a vowel.”);

}else{
printf(“It is a consonant.”);
}
}

 

For Life time valid video tutorials of “C Programming For Beginners” course with quiz and certification : Click Here

Downloadable video tutorials of “C Programming For Beginners” for TTRC Player : Click Here

My Self Subrat Dash. I have completed my MSc in Information Technology. Since last 12 years i am teaching Math and Computer at TTRC Computer Institute situated at Rayagada, Odisha, India. I believe in conceptual learning, so i explain each and every concept with demos and examples, which makes it easier to understand.

    1 Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

error: Content is protected !!