Dangling
else
(cont.)
n
It is associated with the second
if
(B).
n
To associate it with the first, add
braces around everything
contained between the first
if
and
the
else
.
n
n
if
(condition1) {
n
if
(condition2)
n
statement1
n
}
else
n
statement2