← 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?
- A.%d
- B.%f
- C.%lf
- 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 →