#include <iostream>
using namespace std;
int main()
{
string name,password;
cout << "enter your name : ";
cin >> name;
cout << "enter your password : ";
cin >> password;
if (password == "123456")
{
cout << "Hello , " << name << endl;
}
else
{
cout << "Wrong Password" <<endl;
return 0;
}
cout << "here comes our program . . . . . . ";
return 0;
}
#include <iostream>
using namespace std;
int main()
{
string name,password; int x = 1;
login :
cout << "enter your name : ";
cin >> name;
cout << "enter your password : ";
cin >> password;
if (password == "123456")
{
cout << "Hello , " << name << endl;
}
else if (x == 5)
{
cout << "Wrong Username Or Password for 5 times .. Program is terminating .";
return 0;
}
else
{
cout << "Wrong Username Or Password , Please Try again . " << x << " Out Of 5" <<endl;
x++;
goto login;
}
cout << "here comes our program . . . . . . ";
return 0;
