i wrote the following program
#include
main()
{
int i = 2;
float c = 4.5;
printf(\"%d\\n\",c);
printf(\"%f\\n\",i);
return 0;
}
an integer and a float have a different internal representation, so you must not mistake the printf %f with %d to avoid unpredictable results. People uses C expecially because C is fast, and it is fast just because it leave all under the programmer responsibility. So don't expect printf do some magic conversion under the hood because it just won't.