What is the output?void main(){int a,b=5,c=10;a = (b-c) > (c-b) ? b : c;printf("%d",a);}A. 10B. 5C. 0D. Error

Showing Answers 1 - 3 of 3 Answers

Mohammed Suvaid

  • Jan 7th, 2016
 

A. 10
Comment:
? is a ternary operator which returns the first value when the result is true and returns the second value when the result is false i.e a ? b:c when "a" is true it will return "b" else it will return "c".

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions