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;
```
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;
}
```

Computer Science & Information Technology

You might also like to view...

When importing, if a table with the same name as the imported table does not exist, Access will not create the object

Indicate whether the statement is true or false

Computer Science & Information Technology

Which of the following protocols enables packets to be routed on LANs and WANs?

A. IP B. TCP C. DNS D. FTP

Computer Science & Information Technology