Thursday, 2 January 2014

Vowel or Not

A program that tells character is vowel or not.

#include <stdio.h>
#include <stdlib.h>

int main()
{
 char vow;

  printf("Enter a character: ");
  scanf("%c", &vow);

  if (vow == 'a' || vow == 'A' || vow == 'e' || vow == 'E' || vow == 'i' || vow == 'I' || vow =='o' || vow=='O' || vow == 'u' || vow == 'U')    /*a.e.i.o.u  are vowels*/
    {printf("%c is a vowel.\n", vow);}
  else
    printf("%c is not a vowel.\n", vow);
    return 0;
}

No comments:

Post a Comment