Sinux1

T6E7.cpp

Mar 31st, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.66 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. bool print_all(char ending){
  5.     if (ending < 'a' || ending > 'z')
  6.         return false;//This indicates there was a problem
  7.  
  8.  
  9.     for(char counter = 'a'; counter <= ending; counter++)
  10.     {
  11.         cout << counter << endl;
  12.     }
  13.     return true; //Tell me that everything is fine
  14. }
  15.  
  16.  
  17.  
  18. int main(){
  19.  
  20.     char input;
  21.  
  22.     cout << "Enter a lower case character." << endl;
  23.     cin >> input;
  24.  
  25.     if (print_all(input)){
  26.         cout << "Operation completed successfully!!!" << endl;
  27.  
  28.     }
  29.     else{
  30.         cout << "Hey! I said lowercase letter!!! RESPECT MY AUTHORITY!!!" << endl;
  31.     }
  32.     return 0;
  33. }
Add Comment
Please, Sign In to add comment