Advertisement
Guest User

Untitled

a guest
Mar 17th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.  
  9. const string USERNAME = "arvin";
  10. const string PASSWORD = "123456";
  11.  
  12. string username, password;
  13.  
  14.  
  15. cout << "Enter Username : ";
  16. cin >> username;
  17.  
  18. if (username.length() < )
  19. {
  20. cout << "Username length must be atleast 4 characters long.";
  21. }
  22. else
  23. {
  24.  
  25. cout << "Enter Password : ";
  26. cin >> password;
  27.  
  28. if (password.length() < 6)
  29. {
  30. cout << "Password length must be atleast 6 characters long.";
  31. }
  32. else
  33. {
  34.  
  35. if (username == USERNAME && password == PASSWORD)
  36. {
  37. cout << "User credentials are correct!!!" << endl;
  38. }
  39. else
  40. {
  41. cout << "Invalid login details" << endl;
  42. }
  43. }
  44. }
  45. system("pause");
  46. return 0;
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement