Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- bool print_all(char ending){
- if (ending < 'a' || ending > 'z')
- return false;//This indicates there was a problem
- for(char counter = 'a'; counter <= ending; counter++)
- {
- cout << counter << endl;
- }
- return true; //Tell me that everything is fine
- }
- int main(){
- char input;
- cout << "Enter a lower case character." << endl;
- cin >> input;
- if (print_all(input)){
- cout << "Operation completed successfully!!!" << endl;
- }
- else{
- cout << "Hey! I said lowercase letter!!! RESPECT MY AUTHORITY!!!" << endl;
- }
- return 0;
- }
Add Comment
Please, Sign In to add comment