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:

Verified
Correct Answer:
Verified
Related Questions
Q16: In Java, it is possible to create
Q17: How many times will the following loop
Q18: The following loop is syntactically valid:<br>for(int j
Q19: Which of the following would rotate an
Q20: Code Example Ch 06-1<br>In the following example,
Q22: If a switch statement contains no break
Q23: Write a declaration that initializes an int
Q24: What does the break statement do?<br>A) It
Q25: Rewrite the following nested if-else statements using
Q26: You might choose to use a switch