5
QuizMultiple Choice

Operators and Escape Sequences

Question 5 • ASC Programming, Games, Apps and Society

Analyze the following code, which is correct for a conditional operator?

Answer
A
(myAge>=yourAge)?myAge-yourAge:yourAge-myAge
B
(myAge>=yourAge);myAge-yourAge;yourAge-myAge
C
(myAge>=yourAge):myAge-yourAge:yourAge-myAge
D
(myAge>=yourAge)?myAge-yourAge?yourAge-myAge