ACtE08 · Chapter 8Demo2 · Set 1🏛️ Past Licensure QuestionID: 9785962d
Which of the following is NOT a valid format specifier used in the standard C library function printf()?
Which of the following is NOT a valid format specifier used in the standard C library function printf()?
Multiple Choice Options
- A
%d
- B
%s
- C✓ Correct Option
- D
%f
Detailed Technical Solution & Explanation
In the C standard I/O library (<stdio.h>):
•
%d (or %i): Format specifier for signed decimal integers.•
%s: Format specifier for null-terminated character strings.•
%f: Format specifier for floating-point values.•
\t: An escape sequence representing a horizontal tab character, not a format specifier. Format specifiers always begin with the % symbol.Option Analysis:
•
Option A (%d): Valid format specifier for signed integers.
•
Option B (%s): Valid format specifier for string literals and character arrays.
•
Option C (\t): Correct choice;
\t is an escape character for horizontal tab, not a printf format conversion specifier.•
Option D (%f): Valid format specifier for standard floating-point representation.
Reference: Demo2 · Set 1NEC Licensure Syllabus