Hi.. How can I write a program in c++ that can accept a particular password and if not that password then incorrect password...? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Hi.. How can I write a program in c++ that can accept a particular password and if not that password then incorrect password...?

https://www.sololearn.com/discuss/1145740/?ref=app

18th Mar 2018, 1:42 AM
Victor Nwafor
Victor Nwafor - avatar
2 Answers
0
You use a basic if-else block. string pw,pwd="hello"; getline(cin,pw); if(pw==pwd) cout<<"Access Granted. \n"; else cout<<"Incorrect Password. \n";
18th Mar 2018, 3:39 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
0
Thanks brother
22nd Dec 2018, 10:08 PM
Victor Nwafor
Victor Nwafor - avatar