Quiz.md - brainchildservices/curriculum GitHub Wiki
Which are the entry controlled loops?
While loop and for loop
What is a exit control loop?
Exit controlled loop is a loop in which the loop body is executed first and then the given condition is checked afterwards.
what is the main difference between entry control loop and Exit control loop?
entry controlled loop
Entry controlled loop is a loop in which the test condition is checked first, and then loop body will be executed.
If Test condition is false, loop body will not be executed.
Entry Controlled Loops are used when checking of test condition is mandatory before executing loop body.
exit controlled loop
Exit controlled loop is a loop in which the loop body is executed first and then the given condition is checked afterwards.
If Test condition is false, loop body will be executed once.
Exit Controlled Loop is used when checking of test condition is mandatory after executing the loop body.
Define break statement.
A Break statement breaks out of the loop at the current point or we can say that it terminates the loop condition.
Define continue statement.
The continue statement breaks one iteration (in the loop), if a specified condition occurs, and continues with the next iteration in the loop.
Why do we use loop in programming?
When programmers write code, loops allow them to shorten what could be hundreds of lines of code to just a few. This allows them to write the code
once and repeat it as many times as needed, making it more likely for the program to run as expected.
Define syntax of for loop.
for ( init; condition; increment )
{
statement(s);
}