Discussion :: C Preprocessor - Find Output of Program (Q.No.15)
|Nandu said: (Jan 7, 2012)|
|I can't understand the step two, the statement "(5>10?:10)" has become (10).
How is it possible?
|Abhimanyu said: (Jul 15, 2013)|
The statement will the pointer will not go to the true section of ternary operator in case of (5>9) So the the pointer will go in (9>10) and again in false section and answer will be 10.
|Monika said: (Jul 17, 2014)|
|We have evaluate from the right side, (a>b?a:b) if the condition is true then it will take the value of a or else it will take b value.
Here, 9>10 is wrong so its takes the value 10. Then 5>10 is also wrong So again it takes the value 10.
Post your comments here:
Email : (optional)
» Your comments will be displayed only after manual approval.