C Program to Check Whether a Character is Vowel or Consonant Using Switch Statement

Using this article, You are going to know about “C Program to Check Whether a Character is Vowel or Consonant Using Switch Statement“. Yes, Shall we start the article to learn about it? Come on! Let’s go.

C Program to Check Whether a Character is Vowel or Consonant Using Switch Statement

C Program to Check Whether a Character is Vowel or Consonant Using Switch Statement

Source Code

#include <stdio.h>
 
int main()
{
  char ch;
 
  printf("Input a charactern");
  scanf("%c", &ch);
 
  switch(ch)
  {
    case 'a':
    case 'A':
    case 'e':
    case 'E':
    case 'i':
    case 'I':
    case 'o':
    case 'O':
    case 'u':
    case 'U':
      printf("%c is a vowel.n", ch);
      break;
    default:
      printf("%c isn't a vowel.n", ch);
  }              
 
  return 0;
}

Final Words

I hope this article helps you to learn “C Program to Check Whether a Character is Vowel or Consonant Using Switch Statement“. If you face any issues please let me know via the comment section. Share this article with other C/C++ program developers via social networks. Thank You!

Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment