Find the error(s) in the following code, which uses variables to perform a calculation.

```
1 int number1;
2 int number2;
3 int result;
4
5 number1 = (4 * 6 - 4) / (10 % 4 – 2);
6 number2 = (16 / 3) - 2 * 6 + 1;
7 result = number1 - number2;
```

Line 5 attempts to divide by 0, so the expression highlighted below must be changed. Line 6 uses an invalid operator—the \ should be a /.
```
1 int number1;
2 int number2;
3 int result;
4
5 number1 = (4 * 6 - 4) / (10 % 4 – 2);
6 number2 = (16 / 3) - 2 * 6 + 1;
7 result = number1 - number2;
```

Computer Science & Information Technology

You might also like to view...

When a SmartArt object is selected, it has sizing handles around the border

Indicate whether the statement is true or false

Computer Science & Information Technology

The default workspace in Illustrator is called ____.

A. Default B. Normal C. Basic D. Essentials

Computer Science & Information Technology