Member Avatar for James singizi

How can one write a c password program that accepts only 3 attempts of password input

Recommended Answers

All 2 Replies

You can use variable to count the number of attempt with if else condition

If you want to keep the number of attempt to be in the memory. Then you can store it the file. Like if one enter wrong password once and then closes the program, then also there will be only two attempt left as you are storing the last attempt in the memory.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.