FUNDAMENTALS OF COMPUTER

COMPUTER PROGRAMMING FUNDAMENTALS

WHAT IS PROGRAMMING

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
A loop that will repeat so long as a condition true. You don’t know how many times it will loop.
A
for loop
B
while loop
C
loop-de-loop
D
None of the above
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.

Detailed explanation-3: -The while() loop repeats as long as the condition is true (non-zero). If the condition is false the body of the loop never executes at all.

Detailed explanation-4: -While loops are typically used when you don’t know how many times the loop needs to repeat. The body of the loop will repeat while the condition is true. The logical expression will be evaluated just before the body of the loop is repeated.

There is 1 question to complete.