COMPUTER PROGRAMMING FUNDAMENTALS
WHAT IS PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
used to execute a given set of key as long as the given condition evaluates to false
|
|
used to execute a given set of commands as long as the given door evaluates to false
|
|
used to execute a given set of commands as long as the given condition evaluates to false
|
|
None of the above
|
Detailed explanation-1: -The until loop is used to execute a given set of commands as long as the given condition evaluates to false. The condition is evaluated before executing the commands.
Detailed explanation-2: -The while loop is perfect for a situation where you need to execute a set of commands while some condition is true.
Detailed explanation-3: -A Do… Until loop is used when we want to repeat a set of statements as long as the condition is false.
Detailed explanation-4: -In some cases, we have to execute a body of the loop at least once even if the condition is false. This type of operation can be achieved by using a do-while loop. In the do-while loop, the body of a loop is always executed at least once. After the body is executed, then it checks the condition.
Detailed explanation-5: -The main difference is that while loops are designed to run while a condition is satisfied and then terminate once that condition returns false. On the other hand, until loops are designed to run while the condition returns false and only terminate when the condition returns true.