If that condition evaluates as true, the code in the block after it will be executed. The block of code following else will execute if the condition given in the if statement evaluates to be false. However, as a matter of good programming practice, you should include a default case which would print an appropriate warning message. Whether or not you choose to do so is entirely a matter of personal style. Loops Loops allow you to specify that a block of code should execute repeatedly until some logical condition is satisfied.
C provides three types of loop, the while loop, the for loop, and the do-while loop.
When a while loop is encountered condition is evaluated. If it is true, the body of the loop is executed. The condition is then tested again. As long as the condition remains true, the body will be executed repeatedly. Occasionally, it is desirable to have a loop that will execute indefinitely until it is broken by the break or continue keyword.