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

Computer Science & Information Technology

You might also like to view...

What kind of exception is thrown if there's a problem opening or creating a StreamWriter?

a) Exception b) StreamException c) OpenAndCreatingException d) IOException

Computer Science & Information Technology

The ________ icon displays next to the links for all subdocuments, when the master document is collapsed

A) Lock B) Hyperlink C) Hide D) Key

Computer Science & Information Technology

A group of formatting commands, such as font, font size, font color, paragraph alignment, and line spacing, which can be applied with a single command, is known as a(n) ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

COGNITIVE ASSESSMENT Which of the following is NOT true about SSDs?

A. SSDs have slower access times than hard disks. B. Some computers have both a hard disk and an SSD. C. Defragmentation is not required. D. SSDs are quieter than hard disks.

Computer Science & Information Technology