For variable argument functions like printf and scanf, the arguments are promoted, for example, any smaller integer types are promoted to int, float is promoted to double.
scanf takes parameters of pointers, so the promotion rule takes no effect. It must use %f for float* and %lf for double*.
printf will never see a float argument, float is always promoted to double. The format specifier is %f. But C99 also says %lf is the same as %f in printf:
C99 §7.19.6.1 The
fprintffunction
l(ell) Specifies that a followingd,i,o,u,x, orXconversion specifier applies to along intorunsigned long intargument; that a followingnconversion specifier applies to a pointer to along intargument; that a followingcconversion specifier applies to awint_targument; that a followingsconversion specifier applies to a pointer to awchar_targument; or has no effect on a followinga,A,e,E,f,F,g, orGconversion specifier.