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

11. Which function is used to convert a string to uppercase in C?

  • toupper()
  • upper()
  • strupr()
  • strtoupper()
Show Answer Report

12. What does the malloc() function do in C?

  • Memory Allocation
  • Memory Deallocation
  • Memory Reallocation
  • Memory Initialization
Show Answer Report

13. Which function is used to compare two strings in C?

  • strcomp()
  • strcompare()
  • strcmp()
  • compare()
Show Answer Report

14. Which header file contains mathematical functions like sqrt() and pow()?

  • stdlib.h
  • math.h
  • string.h
  • stdio.h
Show Answer Report

15. What does the printf() function return?

  • void
  • int
  • char
  • float
Show Answer Report

16. Which function is used to open a file in C?

  • open()
  • fopen()
  • fileopen()
  • openfile()
Show Answer Report

17. What does the strlen() function return?

  • Number of characters including null
  • Number of characters excluding null
  • Size of string in bytes
  • Pointer to last character
Show Answer Report

18. Which function is used to copy one string to another?

  • strcopy()
  • strcpy()
  • copy()
  • stringcopy()
Show Answer Report

19. What is the purpose of free() function?

  • Allocate memory
  • Deallocate memory
  • Initialize memory
  • Reallocate memory
Show Answer Report

20. Which function is used to read a character from file?

  • getchar()
  • fgetc()
  • getc()
  • readchar()
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test