Answer E17

result: 0

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