Thursday 3 October 2013

Determining whether a character is vowel or not using C

#include <stdio.h>
 main()
{
  char ch;
  printf("\n(There is) none worthy of worship except Allah(Subhanahu wa ta'ala).Muhammad(Sallallahu alayhi wasallam) is Messenger of ALLAH(Subhanahu wa ta'ala).\n");
  printf("Enter a character\n");
  scanf("%c", &ch);
  if (ch == 'a' || ch == 'A' || ch == 'e' || ch == 'E' || ch == 'i' || ch == 'I' || ch =='o' || ch=='O' || ch == 'u' || ch == 'U')
    printf("%c is a vowel.\n", ch);
  else
    printf("%c is not a vowel.\n", ch);
}

No comments:

Post a Comment