ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: e34816f7
In the standard C I/O library (<stdio.h>), which function writes a single character to a specified file stream?
In the standard C I/O library (<stdio.h>), which function writes a single character to a specified file stream?
Multiple Choice Options
- A
fgetc()
- B
fprintf()
- C
fread()
- D✓ Correct Option
fputc()
Detailed Technical Solution & Explanation
fputc(ch, fp) writes a single character ch to the open file stream fp at its current position indicator.
Option Analysis:
•
Option A (fgetc()): Reads a character from a file.
•
Option B (fprintf()): Writes formatted text strings.
•
Option C (fread()): Reads binary blocks.
•
Option D (fputc()): Correct. Writes a single character to the file stream.
Reference: Demo · Set 4NEC Licensure Syllabus