csansoon

P1.07 P42042 Classification of characters (1)

Sep 19th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.36 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. // a=97 e=101
  4. int main() {
  5.     char x;
  6.     cin >> x;
  7.     if (isupper(x)) {
  8.         cout << "uppercase" << endl;
  9.     }
  10.     else {
  11.         cout << "lowercase" << endl;
  12.     }
  13.     if (tolower(x)=='a'||tolower(x)=='e'||tolower(x)=='i'||tolower(x)=='o'||tolower(x)=='u') {
  14.         cout << "vowel" << endl;
  15.     }
  16.     else {
  17.         cout << "consonant" << endl;
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment