Basic

Switch Case

Goto

Operators

if Statement

Nested if

While Loop

For Loop

Array

Patterns

Excersises


C Program to Check whether Vowel or Not using switch case


The following example shows, how to check whether a character is vowel or not using switch case in C program.

Example : pgm.c

#include<stdio.h>
int main(){
  char ch;
  printf("\nEnter the Character : ");
  scanf("%c",&ch);
  switch(ch){
    case 'a':
    case 'e':
    case 'i':
    case 'o':
    case 'u':
      printf("%c is a Vowel",ch);
    break;
    default:
      printf("%c is not a Vowel",ch);
  }
  return 0;
}

Output:

Enter the Character : a
a is a Vowel