Skip to main content

Standard Library Functions — Part 2 MCQs with Explanations

Practice high-yield Programming & Software Development MCQs on Standard Library Functions — Part 2 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 line from the given code is the passive form? #undef assert #ifdef NDEBUG #define assert (test) ( (void) 0) #else #define assert (test) #endif

Question 2 of 40
★ FPSC ★ PPSC

. . . . . . . . defines the minimum value for a short integer.

Question 3 of 40
★ FPSC ★ PPSC

The . . . . . . . . function converts the initial portion of the string pointed to by, to int representation.

Question 4 of 40
★ FPSC ★ PPSC

The ldexp() function multiplies a floating-point number by an integral power of 2.

Question 5 of 40
★ FPSC ★ PPSC

setjmp takes a jmp_buf type and different other type variables as input.

Question 6 of 40
★ FPSC ★ PPSC

What is the name of the function that is used to convert multibyte character to wide character?

Question 7 of 40
★ FPSC ★ PPSC

The header file assert.h of the C Standard Library defines . . . . . . . . macro.

Question 8 of 40
★ FPSC ★ PPSC

The macro offset expands to a constant of type . . . . . . . .

Question 9 of 40
★ FPSC ★ PPSC

LC_COLLATE affects strcoll() and strxfrm() functions.

Question 10 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? double x=1.8; printf("%.2lf",floor(x));

Question 11 of 40
★ FPSC ★ PPSC

Which of the following is not defined under the header file stddef.h?

Question 12 of 40
★ FPSC ★ PPSC

Which of the following library functions is used to read location dependent information?

Question 13 of 40
★ FPSC ★ PPSC

The function computes the hyperbolic cosine of x.

Question 14 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? double log (double -x);

Question 15 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? (By date we mean: date, month and year) #include<stdio.h> #include<stdlib.h> #include<time.h> int main() { time_t ct; time(&ct); printf("%s\n",ctime(&ct)); }

Question 16 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? char str[20]; str= "123546"; res= atof(str); printf("String value = %s, Float value = %f\n", str, res);

Question 17 of 40
★ FPSC ★ PPSC

The C library function . . . . . . . . function converts the wide character to its multibyte representation.

Question 18 of 40
★ FPSC ★ PPSC

A domain error occurs if x is negative and y is not an integral value for the function pow(double x, double y).

Question 19 of 40
★ FPSC ★ PPSC

Which statement is correct work reference to endptr? double strtod(const char *nptr, char **endptr);

Question 20 of 40
★ FPSC ★ PPSC

Which of the following is the correct syntax of the function strtoul()?

Question 21 of 40
★ FPSC ★ PPSC

A less common use of setjmp.h is to create syntax similar to . . . . . . . .

Question 22 of 40
★ FPSC ★ PPSC

What will be the output of the following C code? double x=1.2 printf("%.1lf", ceil(x));

Question 23 of 40
★ FPSC ★ PPSC

Which of the given function differs from the statement'errno is not neccessarily set on conversion error'?

Question 24 of 40
★ FPSC ★ PPSC

The macro MB_LEN_MAX is used to find . . . . . . . .

Question 25 of 40
★ FPSC ★ PPSC

Which function is called by macro assert to terminate the execution?

Question 26 of 40
★ FPSC ★ PPSC

What will be the output of the following C code, if the system date is 6/24/2017? #include<stdio.h> #include<stdlib.h> #include<time.h> int main() { time_t ct; time(&ct); printf("%s\n",(&ct)); }

Question 27 of 40
★ FPSC ★ PPSC

The macro which is used to find the maximum value of an unsigned integer is . . . . . . . .

Question 28 of 40
★ FPSC ★ PPSC

Which of the given statement is not true with respect to void longjmp( jmp-buf env, int val)?

Question 29 of 40
★ FPSC ★ PPSC

void free(void *p) performs which of the following functions?

Question 30 of 40
★ FPSC ★ PPSC

atol(const char *str) Converts the string pointed to, by the argument str.

Question 31 of 40
★ FPSC ★ PPSC

How many macros are defined in the header file stdarg.h?

Question 32 of 40
★ FPSC ★ PPSC

The pointer used in the mblen() function points to the . . . . . . . .

Question 33 of 40
★ FPSC ★ PPSC

What is the role of the given C function? void va_end(va_list ap)

Question 34 of 40
★ FPSC ★ PPSC

The . . . . . . . . macro shall be invoked before any access to the unnamed arguments.

Question 35 of 40
★ FPSC ★ PPSC

Correct code to turn assertions OFF at various places throughout a source file is . . . . . . . .

Question 36 of 40
★ FPSC ★ PPSC

Which among the given function does not return a value?

Question 37 of 40
★ FPSC ★ PPSC

What will the code display on compiling? void funccall() { printf("this is funccall\n"); } void main () { atexit(funccall); printf("program starts\n"); printf("program ends\n"); }

Question 38 of 40
★ FPSC ★ PPSC

What will be the output of the following C code if the system time is 1:52 PM (Sunday)? #include<stdio.h> #include<time.h> int main() { struct tm *ptr; time_t t; char str[100]; t = time(NULL); ptr = localtime(&t); strftime(str,100,"%I",ptr); puts(str); return 0; }

Question 39 of 40
★ FPSC ★ PPSC

The macro definition of INT_MIN is . . . . . . . .

Question 40 of 40
★ FPSC ★ PPSC

Which of the following is defined under the header file time.h?

✓ 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 →