Standard Library Functions MCQs
Practice free Standard Library Functions multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 250 questions — no login required.
Question 127easy
Which function restores the environment saved by the most recent invocation of the setjmp() macro in the same invocation of the program?
Question 128easy
Which function searches an environmenr list that are provided by the host environment?
Question 129easy
What will be the output of the following C code if the name entered is "TOM" and time taken to enter this name is 2 seconds?
#include <stdio.h>
#include <time.h>
int main ()
{
time_t time1,time2;
char get_input [256];
double dif_sec;
time (&time1);
printf ("Please enter the name of your pet: ");
gets (get_input);
time (&time2);
dif_sec = difftime (time2,time1);
printf ("%.2f\n", dif_sec );
return 0;
}Advertisement
Question 130easy
What error occurs if an input argument is outside the domain over which the mathematical function is de?ned?
Question 131easy
The maximum value of a signed char is not the same as the maximum value of an unsigned char.
Question 132easy
What will be the output of the following C code?
Maximum value of int = 1000
Maximum value of float = 5000
Maximum value of short int = 327
Minimum value of short int = -328
#include<stdio.h>
#include<limits.h>
#include<float.h>
main()
{
short int d;
d=INT_MAX + FLT_MAX;
printf("%d",d);
}Advertisement
Question 133easy
Which function is used to recombine the fraction and exponent parts of a floating-point value after you have worked on them separately?
Question 134easy
What will be the output of the following C code?
#include<stdio.h>
#include<time.h>
main()
{
struct tm t;
time_t tc;
t.tm_year=2017-1900;
t.tm_mday=25;
t.tm_mon=5;
t.tm_hour=1;
t.tm_min=30;
t.tm_sec=0;
t.tm_isdst=0;
tc=mktime(&t);
printf(ctime(&tc));
}Question 135easy
Which macro affects the strftime() function?