Compare and contrast the while and for iteration statements.

What will be an ideal response?


The while and for iteration statements repeatedly execute a statement or set of state-
ments as long as a loop-continuation condition remains true. Both statements exe- cute their bodies zero or more times. The for 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 state- ments are used for sentinel-controlled iteration. However, while and for can each be used for either iteration type.

Computer Science & Information Technology

You might also like to view...

What are the basic exploits of a Linux system?

What will be an ideal response?

Computer Science & Information Technology

You can view all of the available building blocks in the:

A) Quick Parts Pane. B) Building Blocks Pane. C) Quick Parts Organizer. D) Building Blocks Organizer.

Computer Science & Information Technology

By default, slides that are added subsequent to the first slide are Title layout slides.

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

Computer Science & Information Technology

The correct HTML code to create a checked check box is ____.

A. B. C. D.

Computer Science & Information Technology