Based on the dangling-else discussion , modify the following code to produce the output shown. Use proper indentation techniques. You must not make any additional changes other than inserting braces. We eliminated the indentation from the following code to make the problem more challenging

```
if (y == 8)
if (x == 5)
cout << "@@@@@" << endl;
else
cout << "#####" << endl; cout << "$$$$$" << endl; cout << "&&&&&" << endl;
```

a) Assuming x = 5 and y = 8, the following output is produced.
```
@@@@@
$$$$$
&&&&&
```

```
if (y == 8) {
if (x == 5) {
cout << "@@@@@" << endl;
}
else {
cout << "#####" << endl;
}
}

cout << "$$$$$" << endl;
cout << "&&&&&" << endl << endl;
```

Computer Science & Information Technology

You might also like to view...

Animations can be set by clicking the Animations button found on the ________ tab

A) Animations B) Settings C) Slide show D) Transitions

Computer Science & Information Technology

A ________ identifies the source of an online resource and is formatted differently from the other text on a slide

A) definition B) citation C) reference D) copyright

Computer Science & Information Technology