Answer E17

result: 0.00

(Your particular environment might print a different number of 0's after the decimal point.)

The expression is

result = a/b + a/b

As before, the subexpressions a/b are evaluated, each resulting in integer zero.

Then the zero is assigned to result. The zero needs to be promoted to double precision 0.0 since that is now the data type of result.

The type of the final value (double) does not affect how the intermediate subexpressions are evaluated.



Back to Puzzle Home