The double type takes a "%lf" as a format specifier.
This is only true with the scanf() family of functions.
The printf() family of functions use the "%f" format specifier, unless you are using a compiler that is compiling as a C11 compliant program. Earlier versions of the standard only accepted the "%f" format specifier for all floating point numbers.
Note: I'm not sure if this feature was changed in C99 or C11, but the current standard C11 now uses "%f" for float and "%lf" for double with printf().