Chapter 4 Quiz Starting Out With C++ 044

Which of the following is an example of a conditional operator?

a.
x > y ? z=1 : z=0;

b.
if (x>y)
   z=1
else
  z=0;

c.
if x>y then z=1 else z=0

d.
? (x>y) : z=1 : z=0;

1 comment: