0

How can i implement the following in C

How can i test for equality between the user's entry and the password. And at the same time dencrease on chances by 1 everytime the user enters the wrong password. I know there must be a loop.And lastly if it's correct, i want to break the loop and end the program.Also if there are no more chances the program should also end. https://code.sololearn.com/cXbsyebFtudG/?ref=app

28th Nov 2021, 4:54 PM
John Delvin
John Delvin - avatar
3 Réponses
+ 1
Include <string.h> header to use strcmp(), a function used to check strings equality http://www.cplusplus.com/reference/cstring/strcmp/ I'll leave the loop part for you ...
28th Nov 2021, 5:02 PM
Ipang
28th Nov 2021, 5:32 PM
John Delvin
John Delvin - avatar
0
Good job! 👍 It's time to decide where to add the loop `break` now ...
28th Nov 2021, 5:34 PM
Ipang