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...

For security reasons, the path in a URL normally represents a(n) ________ on the server.

a. Actual directory. b. Virtual directory. c. File. d. None of the above.

Computer Science & Information Technology

________ is the process of translating a task into a series of commands that a computer will use to perform the task

A) Analyzing B) Programming C) Diagramming D) Debugging

Computer Science & Information Technology

A multiple-person video chat on the Google+ site is a hangout

Indicate whether the statement is true or false

Computer Science & Information Technology

A chipset goes with one or more particular processors

Indicate whether the statement is true or false

Computer Science & Information Technology