It is pretty simple.
In older versions of C (before C99), you can write something like
auto n = 3;
and n will be of type int with a value of 3. You can also write
auto n = 3.14f;
and n will still be int , with a value of 3.
This was called an implicit int, and K and R made it pretty famous.
So you can see that
auto sum = d + i;
just assigns a float type d + i sum , which is an implicit int .
Therefore, the answer is 4.
In newer versions of C (C99 onwards), the implicit int has been removed.
P45 Imminent Aug 01 '17 at 18:32 2017-08-01 18:32
source share