So first up… the
Before we dive deep into the syntax of the
while loop, let’s do a demo.
Inside enter_pin.cpp, we have a program that asks and checks for a password. It uses a
while loop to ask the user for the password over and over again.
Note: You don’t need to understand the code right now.
Compile and execute using the terminal.
When the program asks you to
Enter your PIN:, try the following:
1111 and press enter.
2019 and press enter.
1234 and press enter.