MCQ
Single Best Answer
Moderate
QRewrite the code using the ternary operator:
if (c > d)
x = c;
else
x = d;
ID: #23886
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOL
76 views
Question Info
#23886Q ID
ModerateDifficulty
ICSE Computer Application - Class X - Selection Examination - 2024-25 - MCQ - CALCUTTA PUBLIC SCHOOLTopic
Your Answer
Choose the Best Option
Click any option to instantly check if you're correct.
Correct Answer: Option A
Explanation
Explanation:
The ternary operator is written as:
x = (condition) ? value_if_true : value_if_false;
In this case, if c > d, assign c to x; otherwise, assign d t
o x.
Continue Practice
Share
Share This Question
Challenge a friend or share with your study group.
More from This Topic