Subscribe Us

C program to check vowel or consonant using switch -smartduniya

>> Write a C program to check whether an alphabet is vowel or consonant using Switch statement.

vowel consonant check using switch

>> How to check vowels and consonants using Switch statement in C programming.

Let's go an example :

vowel consonant in c programmning

Logic for check vowel or consonant in C

We know that there are 5 vowels in English alphabet. A , E , I ,O ,U are the Uppercase and a , e, i, o, u for lower case.


  1. At fist we take a input from user and store this input in a variable , ch
  2. Check this variable
  3. If this variable match in 5 vowels then we can say it is vowel otherwise it’s consonant.

Let's learn , How to check vowel or consonant using switch statement in C.

Once you will practice any program through the problem,It will help to remember the program and better understand the program.

Let Suppose a problem is :


C Program to input a character from user through key-board and check whether it is vowel or consonant. Logic to check vowel or consonant in C programming using Switch statement.

>>To solve this problem , we take 'A' as a charecter to check that it's vowel or consonant . obviously it is a vowel. if we take 'j' as a checter , we know it is consonant.

>> Go to the code .

vowel consonant check in c using switch

Note :Click on the button to copy the text from the text field. Try to paste the text (e.g. ctrl+v) afterwards in a different window, to see the effect.

write the above code or copy this code . save this with '.c ' extension.In this screen User have to input a cheracter to check vowel or consonent .

For the first Example , if we take "A" Out put :

vowel consonant check in c

For the second Example , if we take "j" Out put :

check vowel or consonant in c

Hope you understand if you face any problem comment below ,will try to help you.


Don’t forget to Subscribe our Blog to get update. Just put your email on subscribe box and hit subscribe button , next verify your email , it will be done.

You will get every single post when we will upload in Smartduniya.

Also learn this post :

How to write comment in C ?

How to write keyword, identifires in C ?

How to write Printf() function in C ?

Post a Comment