1. Home
  2. Computer Science MCQs
  3. C Programming
  4. Which conversion specifier should scanf use to read a…

Added 30 Nov -0001

Which conversion specifier should scanf use to read a double?

  1. %lf Correct answer
  2. %f
  3. %d
  4. %.2f

Correct answer

A. %lf

14 views

MCQSEXAM

Explanation

For scanf the %lf specifier reads a double, while a plain %f reads a float.

Reference

Asked in: NTS, PPSC IT, Campus Interviews

Preparing for an exam?

Doubts & discussion

Not sure why the answer is A? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More C Programming MCQs

Practise all C Programming MCQs

Similar MCQs