Expert in study
alarm
Ask
Computer Science
Dmitrij Dmitrij Dec 23, 2020

Give the output of the following: int x = (4>3)?4*3:3*4;​

answers: 1
Register to add an answer
The time for answering the question is over
Answer:

12

a ? b : c is the same as If a then b, else c.

So your question is the same as

If 4 > 3 then 4*3 else 3*4.

This is of course an easy computation.

4 is greater than 3 so 4>3 is True. Then it will return 4*3 which evaluates to 12.  Thus it simply returns 12.

Note that even if 4>3 was False (which it isn't) it would still return 3*4 which also is 12.

412
aboard aboard
Dec 23, 2020
For answers need to register.
Contacts
mail@expertinstudy.com
Feedback
Expert in study
About us
For new users
For new experts
Terms and Conditions