COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
WHILE loops are
|
loops which run an unknown number of times
|
|
loops which run for a specific number of times
|
|
the same as if statements
|
|
not part of programming
|
Explanation:
Detailed explanation-1: -A while loop repeats a block of code an unknown number of times until a condition is no longer met. for loops, on the other hand, repeat a block of code a fixed number of times. So, a while loop is useful when you don’t know how many times you want a block of code to execute beforehand.
Detailed explanation-2: -The while loop is used to repeat a section of code an unknown number of times until a specific condition is met.
There is 1 question to complete.