Vidyalelo
C Programming · all questions

Standard Library Functions
practice.

Practice every MCQ with options. Use Show answers when you want the correct option and solution.

250

Questions

7/13

Page

Pick an option on a question to see the right answer and solution.

What does the given C code do?
double atan2 (double y, double x);

Select an option to see the answer and solution.

A type whose alignment requirement is at least as large as that of every data type . . . . . . . .

Select an option to see the answer and solution.

Select the correct statement.

Select an option to see the answer and solution.

If the expression in void assert(int expression) is zero then a message is printed on stderr(standard error file).

Select an option to see the answer and solution.

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

Select an option to see the answer and solution.

The . . . . . . . . function is used to convert the initial portion of the string pointed to by, to unsigned long int representation.

Select an option to see the answer and solution.

Which function restores the environment saved by the most recent invocation of the setjmp() macro in the same invocation of the program?

Select an option to see the answer and solution.

Which function searches an environmenr list that are provided by the host environment?

Select an option to see the answer and solution.

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;
}

Select an option to see the answer and solution.

What error occurs if an input argument is outside the domain over which the mathematical function is de?ned?

Select an option to see the answer and solution.

The maximum value of a signed char is not the same as the maximum value of an unsigned char.

Select an option to see the answer and solution.

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);
}

Select an option to see the answer and solution.

Which function is used to recombine the fraction and exponent parts of a floating-point value after you have worked on them separately?

Select an option to see the answer and solution.

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));
}

Select an option to see the answer and solution.

Which macro affects the strftime() function?

Select an option to see the answer and solution.

. . . . . . . . gives receipt of an interactive attention signals.

Select an option to see the answer and solution.

What will be the output of the following C code?
#include<stdio.h>
#include<limits.h>
main()
{
    if(UCHAR_MAX<=SCHAR_MAX)
        printf("hello");
    else
        printf("good");
}

Select an option to see the answer and solution.

All the functions in this library take as a parameter and return as the output.

Select an option to see the answer and solution.

The following message is displayed in stderr.
Assertion failed: expression, file filenum, line nmn

Select an option to see the answer and solution.

The assert shall be implemented as a . . . . . . . . not as an actual . . . . . . . .

Select an option to see the answer and solution.