#include <iostream>
using namespace std;
class registration{
public:
string userName;
string passWord;
registration(){
cout<<" Enter your username to register "<<endl;
cin>>userName;
cout<<" Enter your password to register "<<endl;
cin>>passWord;
}
};
class login:public registration{
public:
string a;
string b;
login(){
cout<<" enter username to login "<<endl;
cin>>a;
cout<<"enter password to login "<<endl;
cin>>b;
if(a==userName && b==passWord){
cout<<" welcome sir "<<endl;
}else{
cout<<" Invalid user id or password "<<endl;
}
}
};
int main() {
login l;
return 0;
}
No comments:
Post a Comment