Conversions happen to arguments to functions with a prototype which includes the specific parameters. The prototype for printf()
does not include the specific parameters after the first one
int printf(const char *format, ...);
so, no arguments after the 1st one get automatically converted except as defined by "default argument conversions" (basically any integer type with a rank lower than int
to int
and any floating-point type with a rank lower than double
to double
(thank you, Pascal Cuoq)). You need to convert them explicitly yourself with a cast operation
printf("%f %f\n", (double)x, (double)y);
Ohhh ... and you really, really, really should include the header that has the prototype in question (under penalty of Undefined Behaviour)
#include <stdio.h>