You need to write a loop that will repeat exactly 125 times. Which is the preferred loop construct to use?

You need to write a loop that will repeat exactly 125 times. Which is the preferred loop construct to use?

LANGUAGE: JAVA

CHALLENGE:

You need to write a loop that will repeat exactly 125 times. Which is the preferred loop construct to use?

SOLUTION:

for loop

CHALLENGE:

You need to write a loop that will keep reading and adding integers to a sum, until the sum reaches or exceeds 21. The numbers are all less than 20 and the sum is initially 0. Which is the preferred loop construct to use?
SOLUTION:

do while loop

Add comment