C- Library Functions MCQ Questions and Answers

Take Exam

C Library Functions MCQ questions with answers focus on standard C functions like printf(), scanf(), strlen(), strcmp(), and malloc(). These programming questions and answers test how well students understand the C Standard Library and its functions. Practicing programming MCQ with explanations is essential for placement exams and programming interviews in companies like Wipro, Cognizant, and TCS. By revising library functions through C programming test practice online, learners can enhance their coding accuracy and logical thinking, ensuring success in both academic exams and technical interviews.

C- Library Functions MCQ

Showing 10 of 29 questions

1. What will the function rewind() do?

  • Reposition the file pointer to a character reverse.
  • Reposition the file pointer stream to end of file.
  • Reposition the file pointer to begining of that line.
  • Reposition the file pointer to begining of file.
Show Answer Report

2. Input/output function prototypes and macros are defined in which header file?

  • conio.h
  • stdlib.h
  • stdio.h
  • dos.h
Show Answer Report

3. Which standard library function will you use to find the last occurance of a character in a string in C?

  • strnchar()
  • strchar()
  • strrchar()
  • strrchr()
Show Answer Report

4. What is stderr ?

  • standard error
  • standard error types
  • standard error streams
  • standard error definitions
Show Answer Report

5. Does there any function exist to convert the int or float to a string?

  • Yes
  • No
Show Answer Report

6. What is the purpose of fflush() function.

  • flushes all streams and specified streams.
  • flushes only specified stream.
  • flushes input/output buffer.
  • flushes file buffer.
Show Answer Report

7. Can you use the fprintf() to display the output on the screen?

  • Yes
  • No
Show Answer Report

8. What will the function randomize() do in Turbo C under DOS?

  • returns a random number.
  • returns a random number generator in the specified range.
  • returns a random number generator with a random value based on time.
  • return a random number with a given seed value.
Show Answer Report

9. Which header file should be included to use functions like malloc() and calloc()?

  • memory.h
  • stdlib.h
  • string.h
  • dos.h
Show Answer Report

10. Which library function is used to read a string from standard input in C?

  • scanf()
  • gets()
  • read()
  • input()
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test