Compare and contrast the while and for iteration statements.

What will be an ideal response?

The while and for repetition statements repeatedly execute a statement or set of
statements as long as a loop-continuation condition remains true. Both statements
execute their bodies zero or more times. The for repetition statement specifies the
counter-controlled-repetition details in its header, whereas the control variable in a
while statement normally is initialized before the loop and incremented in the loop's
body. Typically, for statements are used for counter-controlled repetition, and while
statements for sentinel-controlled repetition. However, while and for can each be
used for either repetition type.

Computer Science & Information Technology

You might also like to view...

Applying the COUNT function to a ________ table will result in only the displayed table rows being counted

Fill in the blank(s) with correct word

Computer Science & Information Technology

Answer the following questions true (T) or false (F)

1. Overloading an operator cannot change the precedence of that operator with respect to other operators. 2. If I need to build an object for return from a function, I can construct that function directly in the return statement.

Computer Science & Information Technology