Which format specifier is used in printf() to display a float value?
-
A
%f
Correct answer
-
B
%d
-
C
%c
-
D
%s
18 views
Explanation
%f prints floating-point values; %d prints integers, %c characters and %s strings.
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