COMPUTER PROGRAMMING FUNDAMENTALS
WHAT IS PROGRAMMING
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
Loop around once
|
|
Keep looping until the condition is true
|
|
Keep looping until the false condition is met
|
|
Save Variables
|
Detailed explanation-1: -A “While” Loop is used to repeat a specific block of code an unknown number of times, until a condition is met. For example, if we want to ask a user for a number between 1 and 10, we don’t know how many times the user may enter a larger number, so we keep asking “while the number is not between 1 and 10".
Detailed explanation-2: -A Do… Until loop is used when we want to repeat a set of statements as long as the condition is false.
Detailed explanation-3: -A “Do Until” loop statement runs until a logical statement is true. • This means that as long as your expression is false, the program will run until it is true. • Once the expression is true, the program stops running.
Detailed explanation-4: -The only difference between do while and do until is that the first one loops as long as the condition is true, while the second one loops as long as the condition is false. Use the ! operator to negate the condition to get the same functionality as until .