Explore topic-wise MCQs in Advanced C Interview.

This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Advanced C Interview knowledge and support exam preparation. Choose a topic below to get started.

1.

puts() function adds newline character?

A. True
B. False
C. Depends on the standard
D. Undefined behaviour
Answer» E.
2.

gets() and puts() operate on ___________

A. stdin and stdout
B. files
C. stderr
D. nothing
Answer» D. nothing
3.

fputs() adds newline character.

A. True
B. False
C. Depends on the standard
D. Undefined behaviour
Answer» C. Depends on the standard
4.

what is the return value of fputs()?

A. EOF if an error occurs
B. Non-negative if no error
C. EOF if an error occurs & Non-negative if no error
D. None of the mentioned
Answer» B. Non-negative if no error
5.

Which of the following is the right declaration for fgets() inside the library?

A. int *fgets(char *line, int maxline, FILE *fp);
B. char *fgets(char *line, int maxline, FILE *fp);
C. char *fgets(char *line, FILE *fp);
D. int *fgets(char *line, FILE *fp);
Answer» D. int *fgets(char *line, FILE *fp);
6.

Which function has a return type as char pointer?

A. getline
B. fputs
C. fgets
D. all of the mentioned
Answer» C. fgets
7.

getc

A. putc
B. fgets
C. fputs
Answer» D.
8.

fputs() function writes a string to a file that only ends with a newline.

A. True
B. False
C. Depends on the standard
D. Depends on the compiler
Answer» E.