sahajjain01

20.Input an alphabet and check if it's a vowel.

Aug 19th, 2015
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1. //Program to input an alphabet and check if it's a vowel.
  2. #include<stdio.h>
  3. #include<conio.h>
  4.  
  5. void main()
  6. {
  7.     char ch;
  8.  
  9.     clrscr();
  10.  
  11.     printf("Enter an alphabet: ");
  12.     scanf("%c", &ch);
  13.  
  14.     if(ch == 'a' || ch == 'e' || ch == 'i' || ch == 'o' || ch == 'u' || ch == 'A' || ch == 'E' || ch == 'I' || ch == 'O' || ch == 'U')
  15.         printf("The alphabet %c is a vowel.", ch);
  16.     else
  17.         printf("The alphabet %c is not a vowel.", ch);
  18.  
  19.     getch();
  20. }
Advertisement
Add Comment
Please, Sign In to add comment