Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream> // library that contains basic input output functions
- #include <string> // library for c++ strings
- using namespace std;
- int main()
- {
- //Username and Password to validate credentials
- const string USERNAME = "ali";
- const string USERNAME2 = "Shahab";
- const string PASSWORD2 = "14567";
- const string PASSWORD = "564";
- string username, password;
- cout << "Enter Username : ";
- cin >> username;
- cout << "Enter Password : ";
- cin >> password;
- //Checking if user's entered credentials are equal to actual USERNAME and PASSWORD
- if (username == USERNAME && password == PASSWORD)
- {
- cout << "User credentials are correct!!!" << endl;
- cin.get();
- }
- else
- {
- if (username == USERNAME2 && password == PASSWORD2)
- {
- cout << "User credentials are correct!!!" << endl;
- cin.get();
- }
- else
- {
- cout << "Invalid login details" << endl;
- cin.get();
- }
- }
- cin.get();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement