Advertisement
Rejuan706

Check

Jun 7th, 2021
217
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.63 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. int main()
  4. {
  5.     char ch;
  6.  
  7.     printf("Enter any character: ");
  8.     scanf("%c", &ch);
  9.  
  10.     if((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z'))
  11.     {
  12.         printf("\n'%c' is alphabet.\n", 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.         {
  16.             printf("vowel");
  17.         }
  18.         else
  19.             printf("Consonant");
  20.     }
  21.     }
  22.     else if(ch >= '0' && ch <= '9')
  23.     {
  24.         printf("\n'%c' is digit.\n", ch);
  25.     }
  26.     else
  27.     {
  28.         printf("\n'%c' is special character.\n", ch);
  29.     }
  30.  
  31.     return 0;
  32. }
  33.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement