C

Asked • 04/13/19

Correct format specifier for double in printf?

What is the correct format specifier for `double` in printf? Is it `%f` or is it `%lf`? I believe it's `%f`, but I am not sure.###Code sample #include int main() { double d = 1.4; printf("%lf", d); // Is this wrong? }

1 Expert Answer

By:

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.