Compare and contrast the break and continue statements.

What will be an ideal response?


The break and continue statements alter the flow of control through a control statement.
The break statement, when executed in one of the repetition statements, causes
immediate exit from that statement. Execution typically continues with the first
statement after the control statement. In contrast, the continue statement, when executed in a repetition statement, skips the remaining statements in the loop body andproceeds with the next iteration of the loop. In while and do…while statements, the application evaluates the loop-continuation test immediately after the continue
statement executes. In a for statement, the increment expression executes, then the
application evaluates the loop-continuation test.

Computer Science & Information Technology

You might also like to view...

Consider the code below:

Dim a() As Integer = {99, 22, 11, 3, 11, 55, 44, 88, 2, -3} Dim result As Integer = 0 For i As Integer = 0 To a.Length - 1 If a(i) > 30 Then result += a(i) End If Next The value of variable result will be: a) 280 b) 154 c) 286 d) 332

Computer Science & Information Technology

The partition style that uses a partition table that describes the location of the partitions on the disk, and on which the first sector contains a hidden binary code file that is used for booting the system is called _________

a. GUID partition table (GPT) b. Dynamic tabling c. Master boot record (MBR) d. None of the above

Computer Science & Information Technology

Routers operate at the ____ layer of the OSI model.

A. Network B. Transport C. Data Link D. Physical

Computer Science & Information Technology

What is used to compare Strings in Java for equality?

A. = operator B. == operator C. compareTo method D. equals method

Computer Science & Information Technology