Can anyone make the program of password generator with do while | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Can anyone make the program of password generator with do while

if the user gives the password correct in 3 times then it show else no more password user entered can anyone just give the syntax!!!!!! //i request some of my friend by sending him notification ....i hope u wll give my answer Dan Walker Dev Hans Larry ‎ ‏‏‎Sreejith  Helga Fata1 Err0r Arun Tomar HAWKEYE Gaurav Agrawal

4th Aug 2018, 2:05 PM
Harsh Agrawal
Harsh Agrawal - avatar
6 Answers
+ 1
line no. 15: key = 1 line no. 32 (after first bracket): key++ line no. 33: while(key<=3)
4th Aug 2018, 5:06 PM
‎ ‏‏‎Anonymous Guy
+ 1
but why do you want it to be with do while?
4th Aug 2018, 2:44 PM
Helga
Helga - avatar
+ 1
//loops 3 times //after 3rd wrong attempt program exits //loop works atleast one time //you asked for syntax, consider this as a pseudo code int key = 1; string pass; while(key <=3){ cout<<"enter pass"<<endl; cin >> pass; if(pass =="correct") break; else cout<<"wrong pass"<<endl; key++; } if(switch > 3) cout << "limit exceeded.\nTry again later"<<endl; else cout << "You found the correct pass" << endl;
4th Aug 2018, 3:42 PM
‎ ‏‏‎Anonymous Guy
4th Aug 2018, 5:10 PM
Harsh Agrawal
Harsh Agrawal - avatar
0
Helga so whats other apparopriate method of using this as i want to do with do while because do while give us a result once even if the condition is false so if the user wwrite wrong choice it wll ask it for again n again........so plz help me...........in doing this program
4th Aug 2018, 2:55 PM
Harsh Agrawal
Harsh Agrawal - avatar
0
‎ ‏‏‎Sreejith  can u give the syntax with java n also with do while loop!!!!! if u confused about my question then plzzz check it my this code https://code.sololearn.com/cm50EveDaMFx/?ref=app I have only problem with that if the user give 3 times wrong password then the progam exit........
4th Aug 2018, 4:18 PM
Harsh Agrawal
Harsh Agrawal - avatar