I am reading Beginning Programming with C for dummies came across a code I couldn't understand
#include <stdio.h>
int main(void)
{
printf("The total is %d\n", 16.0 + 17);
}
It show output as:
The total is 0
I thought that first 16.0 + 17
will automatically type cast to 16.0 + 17.0 = 33.0
then the fractional will be truncated while printing it's value and the final output will be:
The total is 33
Can you explain why the output comes out to be 0
: