Advertisement
Guest User

Untitled

a guest
Jun 1st, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.69 KB | None | 0 0
  1. //simple login
  2. //using logical operators
  3.  
  4. #include <iostream>
  5. #include <string>
  6. using namespace std;
  7.  
  8. int main()
  9. {
  10.  
  11. cout<<"Simpile login....\n\n";
  12.  
  13. int security = 0;
  14.  
  15. string username;
  16. cout<<"username:";
  17. cin>>username;
  18.  
  19.  
  20. string password;
  21.  
  22. cout<<"passoword:";
  23. cin>>password;
  24.  
  25.  
  26. if(username=="me") && (password=="pass")
  27. {
  28. cout<<"\nWelcome my to my network :)\n\n";
  29.   security = 5;    
  30. }
  31. /* couldn't understand why it outputed this all the time but
  32. now I understand :D I had to change the value of security to true in the if statment
  33. so it wouldn't make it  "not not" all the time*/
  34. if(!security)
  35. {
  36. cout<<"pass or username incorrect\n";
  37. }
  38.  
  39. system("pause");
  40.  
  41. return 0;
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement