#18 Java for Loop
The for Loop Loops are structures used to make the program repeat one or many instructions for ‘n’ times as specified in the declaration of the loop. The for Loop can be used for just one statement: for(initialization; condition; iteration) statement; or to repeat a block of code: for(initialization; condition; iteration) { statement sequence } Initialization = assignment statement that sets the initial value of the loop control variable, (counter) Condition = Boolean expression that determines whether or not the loop will repeat Iteration = amount by which the loop control variable will change each time the loop is repeated. The for loop executes only/till the condition is true. Example: using a ‘for’ loop to print the square roots of the numbers between 1 and 99. (It also displays the rounding error present for each square root). // Show square roots of 1 to 99 and the rounding error. class SqrRoot { public stati