Compare and contrast the while and for iteration statements.

What will be an ideal response?


Both iteration statements execute their bodies zero or more times. The for statement
can declare all the elements of counter-controlled repetition in its header, whereas the while statement header contains only a required loop-continuation condition. In the for statement, eliminating the loop-continuation condition results in an infinite loop, whereas in a while statement this is a syntax error.

Computer Science & Information Technology

You might also like to view...

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

1. Mentioning a base class B in an exception specification includes a class D objects, where D is derived from B, in the exception specification. 2. In type matching to select a catch block, only exact matches work.

Computer Science & Information Technology

The _________ determines when a page should be brought into main memory.

A) ?page fault ? B) ?fetch policy C) ?working set ? D) ?resident set management

Computer Science & Information Technology

In a database, a report is used to easily enter data

Indicate whether the statement is true or false

Computer Science & Information Technology

Because of Alice’s drag-and-drop interface, Alice programs cannot contain

a.Syntax errors b.Runtime errors c.Logical errors d.Errors e.None of these

Computer Science & Information Technology