Saturday, September 15, 2012

Code # 13:C Program To Check Whether Input Is Vowel or Not By Using Switch Statement

| |

#include <stdio.h>

main()
{
  char ch;

  printf("Enter a character\n");
  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 is not a vowel.\n", ch);
  }              

  return 0;
}

0 comments:

Post a Comment

Powered by Blogger.