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

21. What does calloc() initialize the allocated memory to?

  • Garbage value
  • Zero
  • One
  • NULL
Show Answer Report

22. Which function is used to write formatted output to string?

  • printf()
  • fprintf()
  • sprintf()
  • format()
Show Answer Report

23. What is the return type of sizeof operator?

  • int
  • unsigned int
  • size_t
  • long int
Show Answer Report

24. Which function searches for a character in a string?

  • strstr()
  • strchr()
  • strfind()
  • search()
Show Answer Report

25. What does realloc() function do?

  • Allocate new memory
  • Deallocate memory
  • Change size of allocated memory
  • Initialize memory
Show Answer Report

26. Which function is used to close a file in C?

  • close()
  • fclose()
  • fileclose()
  • endfile()
Show Answer Report

27. What does the floor() function return?

  • Smallest integer >= argument
  • Largest integer <= argument
  • Rounded value
  • Absolute value
Show Answer Report

28. Which function is used to concatenate two strings?

  • strconcat()
  • concat()
  • strcat()
  • strjoin()
Show Answer Report

29. What is the purpose of fflush() function?

  • Clear input buffer
  • Flush output buffer
  • Fill buffer
  • Delete buffer
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test