Thread: Quiz Time
View Single Post
  #66 (permalink)  
Old 05-08-2008, 01:43 PM
rjuyal's Avatar
rjuyal rjuyal is offline
Senior Member
 
Join Date: Mar 2008
Location: Delhi, India
Posts: 187
rjuyal is on a distinguished road
answer is

Code:
Value is: - 2.0
Reason being

a>5 evaluates to false so the answer should be

Code:
Value is: - 2
but,

2.3 ( double) and 2(int) are of different types. So the type chosen by Ternary will be by rule of promotion, hence 2 will be converted to 2.0

and the answer is


Code:
Value is: - 2.0
__________________
i am the future
Reply With Quote