Advertisement
inhuman_Arif

Problem 3

Sep 29th, 2021
684
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.72 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. typedef long long ll;
  5.  
  6. int main()
  7. {
  8.     #ifndef ONLINE_JUDGE
  9.         freopen("input.txt", "r", stdin);
  10.         freopen("output.txt", "w", stdout);
  11.     #endif
  12.  
  13.     char ch;
  14.     cin >> ch;
  15.     if((int)ch>=48 && (int)ch<=57)
  16.         printf("%c is a digit\n",ch);
  17.     else if(((int)ch>=65 && (int)ch<=90)||((int)ch>=97 && (int)ch<=122))
  18.     {
  19.         if(ch=='A' || ch=='a' ||ch=='E' || ch=='e' ||ch=='I' || ch=='i' ||ch=='O' || ch=='o' ||ch=='U' || ch=='u')
  20.             printf("%c is an alphabet: it is an vowel\n",ch);
  21.         else
  22.             printf("%c is an alphabet\n",ch);
  23.     }
  24.     else
  25.         printf("%c is a special character\n",ch);
  26.    
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement