Q:

C Program to check whether character is vowel or not

0

Write a C Program to check whether character is vowel or not using switch statement. Here’s simple Program to check whether character is vowel or not using switch statement in C Programming Language.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Below is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System to produce desired output as shown below :

SOURCE CODE : :

/*  C Program to check whether character is vowel or not using switch statement  */

#include<stdio.h>

int main()
{
  char ch;
  printf("Enter a character to check :: ");
  scanf("%c",&ch);
  switch(ch)
  {
  case 'a':
         printf("\nThe entered character %c is a vowel",ch);
         break;
  case 'e':
         printf("\nThe entered character %c is a vowel",ch);
         break;
  case 'i':
         printf("\nThe entered character %c is a vowel",ch);
         break;
  case 'o':
         printf("\nThe entered character %c is a vowel",ch);
         break;
  case 'u':
         printf("\nThe entered character %c is a vowel",ch);
         break;
  default:
         printf("\nThe entered character %c is a consonant",ch);
  }

  return 0;
}

OUTPUT : :

 

/*  C Program to check whether character is vowel or not using switch statement  */

---------------------------------------------------

Enter a character to check :: s

The entered character s is a consonant

---------------------------------------------------

Enter a character to check :: i

The entered character i is a vowel

---------------------------------------------------

Enter a character to check :: a

The entered character a is a vowel

 

Above is the source code for C Program to check whether character is vowel or not using switch statement which is successfully compiled and run on Windows System.The Output of the program is shown above .

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

C Basic Solved Programs – C Programming

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
Write a C Program To find the biggest and smallest... >>
<< Write a C Program to check triangle is a equilater...