daily pastebin goal
43%
SHARE
TWEET

Untitled

a guest Mar 14th, 2018 54 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. //recursive function that asks for user to enter a given range of input
  2. //returns either y or n
  3. string user_input ()
  4. {
  5.     cout << "Enter either y or n";
  6.     string input;
  7.     cin >> input;
  8.  
  9.     if (input == "y" || input == "n")
  10.     {
  11.         return input;
  12.     }
  13.     else
  14.         return user_input();
  15. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top