Advertisement
dirtydevil123

string (Fb login)

Jul 3rd, 2021
1,091
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.67 KB | None | 0 0
  1. #include<iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     string actual_username = "iub", actual_password = "123";
  8.     string given_username, given_password;
  9.  
  10.     for(int i=0; i<5; i++)
  11.     {
  12.         cout<<"enter username and password\n";
  13.         cin>>given_username>>given_password;
  14.         if(actual_username==given_username)
  15.         {
  16.             if(actual_password==given_password)
  17.             {
  18.                 cout<<"login successful\n";
  19.                 break;
  20.             }
  21.             else
  22.             {
  23.                 cout<<"login failed\n";
  24.             }
  25.         }
  26.         else
  27.         {
  28.             cout<<"login failed\n";
  29.         }
  30.     }
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement