What is the rule for lining up, or matching, elses?

A. The first else goes with the first if.
B. Else goes with the closest previous if that does not have its own else.
C. The else goes with the one that is indented identically to it.
D. Else matches the closest if that follows it.

Answer: B

Computer Science & Information Technology

You might also like to view...

The position of an item in an array is specified using a

a) subscripted variable b) vector c) subscript d) dimension statement

Computer Science & Information Technology

Natural languageis a set of English language constructs designed to resemble the statements in a programming language but that do not actually run on a computer. _________________________

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

Computer Science & Information Technology