What does the %d format specifier represent in scanf()?
-
A.
Floating-point input
-
B.
Character input
-
C.
Integer input
-
D.
String input
Correct Answer:
C. Integer input
Explanation:
The %d format specifier in the scanf() function is specifically designed to read and process integer input from the standard input stream. When the program encounters %d, it instructs the computer to interpret the incoming sequence of characters as a signed decimal integer and store that value in the memory address of the corresponding integer variable. This specifier ignores leading whitespace and stops reading once it encounters a non-numeric character.
Click below to open Discussion & Feedback
0 Issues
Please
login to comment or Report Issues.