Which conversion specifier should scanf use to read a double?
-
A
%lf
Correct answer
-
B
%f
-
C
%d
-
D
%.2f
14 views
Explanation
For scanf the %lf specifier reads a double, while a plain %f reads a float.
Reference
Asked in: NTS, PPSC IT, Campus Interviews
Doubts & discussion
Not sure why the answer is A? Ask here and get an explanation.
Ask a doubt about this MCQ