This if statement should assign the heavier weight to heaviest and
the lighter weight to lightest. What is wrong with this code?

```1 if (weight1 > weight2)
2 heaviest = weight1;
3 lightest = weight2;```
A. Nothing. It works fine.
B. Heaviest is weight1 regardless of the if statement.
C. The statement is written incorrectly – crash.
D. Line 3 gets executed no matter what. {} are needed.


D

Computer Science & Information Technology

You might also like to view...

When comparing two versions of a presentation, the differences are marked as ________

Fill in the blank(s) with correct word

Computer Science & Information Technology

As a general rule, you should _____.

A. center column titles, left-align text, and right-align numbers B. center column titles, right-align text, and left-align numbers C. right-align column titles, left-align text, and right-align numbers D. left-align column titles, left-align text, and right-align numbers

Computer Science & Information Technology

If you create a conditional formatting rule you can modify it using the Conditional Formatting ____.

A. Rules Options dialog box B. Rules template C. Rules Wizard D. Rules Manager

Computer Science & Information Technology

How many bits are in an IPv6 address?

A. 32 B. 48 C. 64 D. 128

Computer Science & Information Technology