daily pastebin goal
3%
SHARE
TWEET

Username and Password Test

crookedmouth Mar 14th, 2019 187 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     string username = regUserInput;
  2.     string password = regPassInput;
  3.  
  4.     string userInput;
  5.     string passInput;
  6.  
  7.     cout << endl;
  8.  
  9.     while (userInput != username) {
  10.         cout << "Enter Username: " << endl;
  11.         cin >> userInput;
  12.  
  13.         if (userInput != username) {
  14.             cout << "Wrong Username Try Again!" << endl;
  15.         }
  16.     }
  17.  
  18.     if (userInput == username) {
  19.  
  20.         while (passInput != password) {
  21.             cout << "Enter Password: " << endl;
  22.             cin >> passInput;
  23.  
  24.             if (passInput != password) {
  25.                 cout << "Wrong Password Try Again!" << endl;
  26.             }
  27.  
  28.             if (passInput == password) {
  29.                     cout << "Working!" << endl;
  30.             }
  31.         }
  32.     }
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