🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Data Types and Operators: all 10 questions

Quiz: C Data Types and Operators · Question 8 of 10

Which format specifier reads a double with scanf?

Which format specifier reads a double with scanf?

  1. A.%d
  2. B.%f
  3. C.%lf
  4. D.%c
Answer & explanation

Correct answer: %lf

scanf needs %lf for double; %f is for float. (printf accepts %f for both.)

Can you get the rest right without peeking?

Take the timed Quiz: C Data Types and Operators quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →