C- Library Functions MCQ Questions and Answers
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()
12. What does the malloc() function do in C?
- Memory Allocation
- Memory Deallocation
- Memory Reallocation
- Memory Initialization
13. Which function is used to compare two strings in C?
- strcomp()
- strcompare()
- strcmp()
- compare()
14. Which header file contains mathematical functions like sqrt() and pow()?
- stdlib.h
- math.h
- string.h
- stdio.h
16. Which function is used to open a file in C?
- open()
- fopen()
- fileopen()
- openfile()
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
18. Which function is used to copy one string to another?
- strcopy()
- strcpy()
- copy()
- stringcopy()
19. What is the purpose of free() function?
- Allocate memory
- Deallocate memory
- Initialize memory
- Reallocate memory
20. Which function is used to read a character from file?
- getchar()
- fgetc()
- getc()
- readchar()