Solved

How Can the Following Statement Be Rewritten Using a Conditional

Question 21

Multiple Choice

How can the following statement be rewritten using a conditional operator? if(x <0) y = x;
Else y = 0;


A) y = (x < 0) ? x : 0;
B) x = (x < 0) ? y : 0;
C) (x < 0) ? y = x : y = 0;
D) y = (x < 0) ;
E) y = if(x < 0) x : 0;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions