What is y after the following statement is executed?

x = 0;
y = (x > 0) ? 10 : -10;
a. -10
b. 0
c. 10
d. 20
e. Illegal expression


a This conditional operator is correct. It assigns -10 to y since x > 0 is false.

Computer Science & Information Technology

You might also like to view...

What is a field in Word?

A) a column heading B) a category of data that can be inserted into a document C) a category of data used to identify a file D) a cell within a table

Computer Science & Information Technology

The color wheel is made up of _________________________ .

a. three primaries, three secondaries, and six intermediate colors b. three primaries, four secondaries, and four intermediate colors c. three primaries, three secondaries, three intermediates, and three near mediate colors

Computer Science & Information Technology

________ is a measure of how two sets of data vary simultaneously.

A. Deviation B. Covariance C. Probability D. Frequency

Computer Science & Information Technology

In a composition, brightness is used to direct the viewer's eye to a specific area or image.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology