This code checks whether an input alphabet is a vowel or not. Both lower-case and upper-case are checked.


#include <stdio.h>
main()
{
  char ch;
  
  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);
      
  return 0;
}


OUTPUT

check character case output

Designed By Blogger Templates | Templatelib & Distributed By Blogspot Templates