Skip to main content

Standard Library Functions — Part 1 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Standard Library Functions — Part 1 with worked academic solutions for FPSC, PPSC, NTS, NITB, PTS.

Questions
40
Difficulty Level
Exam-Level
Target Exams
FPSC, PPSC, NTS...
Estimated Time
48 mins
Exam-Level FPSC PPSC NTS NITB PTS
Verified for Commission Syllabus • Oct 14, 2026
40

Verified Practice Questions

Interactive test mode with detailed academic worked solutions

Live Progress | 0/40 answered
✓ 0 correct ✗ 0 wrong 0% score
Question 1 of 40
★ FPSC ★ PPSC

Which standard library function is used to calculate the length of a string in C?

Question 2 of 40
★ FPSC ★ PPSC

What is the purpose of the 'printf' function in C?

Question 3 of 40
★ FPSC ★ PPSC

Which library should be included to use the 'sqrt' function in C?

Question 4 of 40
★ FPSC ★ PPSC

What does the 'strcmp' function in C do?

Question 5 of 40
★ FPSC ★ PPSC

What is the return value of the 'rand' function in C?

Question 6 of 40
★ FPSC ★ PPSC

Which function is used to generate a random number in C?

Question 7 of 40
★ FPSC ★ PPSC

What is the purpose of the 'atoi' function in C?

Question 8 of 40
★ FPSC ★ PPSC

Which library should be included to use the 'sin' function in C?

Question 9 of 40
★ FPSC ★ PPSC

What does the 'fgets' function in C do?

Question 10 of 40
★ FPSC ★ PPSC

Which function is used to open a file in C?

Question 11 of 40
★ FPSC ★ PPSC

What is the purpose of the 'abs' function in C?

Question 12 of 40
★ FPSC ★ PPSC

Which standard library function is used to clear the standard input buffer in C?

Question 13 of 40
★ FPSC ★ PPSC

What does the 'strcpy' function in C do?

Question 14 of 40
★ FPSC ★ PPSC

Which function is used to find the smallest integer greater than or equal to a given floating-point number in C?

Question 15 of 40
★ FPSC ★ PPSC

What is the purpose of the 'strcpy' function in C?

Question 16 of 40
★ FPSC ★ PPSC

Which library should be included to use the 'pow' function in C?

Question 17 of 40
★ FPSC ★ PPSC

What does the 'strcat' function in C do?

Question 18 of 40
★ FPSC ★ PPSC

Which standard library function is used to find the largest integer less than or equal to a given floating-point number in C?

Question 19 of 40
★ FPSC ★ PPSC

What is the purpose of the 'tolower' function in C?

Question 20 of 40
★ FPSC ★ PPSC

What is the return value of the 'getchar' function in C?

Question 21 of 40
★ FPSC ★ PPSC

What does the 'getch' function in C do?

Question 22 of 40
★ FPSC ★ PPSC

Which function is used to find the square root of a number in C?

Question 23 of 40
★ FPSC ★ PPSC

What is the purpose of the 'isalpha' function in C?

Question 24 of 40
★ FPSC ★ PPSC

Which standard library function is used to open a file in C?

Question 25 of 40
★ FPSC ★ PPSC

What does the 'abs' function in C do?

Question 26 of 40
★ FPSC ★ PPSC

The C library macro type . . . . . . . . retrieves the next argument in the parameter list of the function with type.

Question 27 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? char str[20]; strcpy(str, "123456"); res = atoi(str); printf("%s %d\n", str, res);

Question 28 of 40
★ FPSC ★ PPSC

MB_CUR_MAX is not defined in stdlib.h.

Question 29 of 40
★ FPSC ★ PPSC

What is the type declared by the header file signal.h?

Question 30 of 40
★ FPSC ★ PPSC

The source filename and line number come from the preprocessor macros . . . . . . . . and . . . . . . . .

Question 31 of 40
★ FPSC ★ PPSC

What will the given C code do? #include <stdlib.h> _Mbsave_Mbxlen={0}; int (mblen)(const char *s ,size_t n) { return(_Mbtowc(NULL s,n,&_Mbxlen)); }

Question 32 of 40
★ FPSC ★ PPSC

Which of the given statement is true with respect to the function atexit()?

Question 33 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? #include <assert. h> #include <stdio . h> #include <stdlib.h> void -Assert (char *mesg) { fputs (mesg, stderr); fputs (" -- assertion failed\n" , stderr); abort () ; }

Question 34 of 40
★ FPSC ★ PPSC

Which is the true statement with respect to the function longjmp()?

Question 35 of 40
★ FPSC ★ PPSC

Which among the given header file is used to handle different signals reported during program execution?

Question 36 of 40
★ FPSC ★ PPSC

Which of the given function is used for searching?

Question 37 of 40
★ FPSC ★ PPSC

The library function clock() returns the number of . . . . . . . . elapsed since the start of the program.

Question 38 of 40
★ FPSC ★ PPSC

Which of the given C function can be used instead of the apparent identity pointed to by y? int x=1; double y= 0.5 * (exp (x) + exp (-x));

Question 39 of 40
★ FPSC ★ PPSC

Select the right statement with reference to malloc() and calloc().

Question 40 of 40
★ FPSC ★ PPSC

Which is the correct declaration of macro assert?

✓ Link copied to clipboard
Continue Your Practice

Advance Html — Part 1

Master the next curriculum module with 40 exam-standard MCQs.

Next Practice Set →

💡 Examiner's Advisory for Programming & Software Development

In competitive commission exams (FPSC, PPSC, KPPSC, SPSC, CSS, PMS), questions are frequently phrased with distractor options designed to catch rote learners. Whenever you answer an MCQ, read the Detailed Academic Explanation and Conceptual Anchor to understand why the remaining options are incorrect.

More Modules in Programming & Software Development

View All →
📚

Study Guides

Topic summaries and syllabus breakdown

Explore Guides →
🎯

Complete Library

Search through 78,000+ verified MCQs

Browse Library →
📱

Mobile App

Offline mock tests and instant bookmarks

Get Mobile App →