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

9/13

Page

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

Which function will return the quotient and remainder on division of numerator with denominator?

Select an option to see the answer and solution.

What will be the output of the following C code if it is executed on 2nd January, 2017 (system date)?
#include<stdio.h>
#include<time.h>
int main()
{
    struct tm *local, *gm;
    time_t t;
    t=time(NULL);	
    local=localtime(&t);
    printf("%d",local->tm_yday);
    return 0;
}

Select an option to see the answer and solution.

The function abort() is defined in which of the following header file?

Select an option to see the answer and solution.

HUGE_VAL macro is used when the output of the function may not be . . . . . . . .

Select an option to see the answer and solution.

Which statement is true with respect to RAND_MAX?

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()
{
    printf("%f",FLT_MIN);
}

Select an option to see the answer and solution.

What will be the output of the following C code if the system date is 8/22/2016?
#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,"%B",ptr);
    puts(str);
    return 0;
}

Select an option to see the answer and solution.

The purpose of the function ctime() is that . . . . . . . .

Select an option to see the answer and solution.

The macros defined under the header file limits.h are not defined under any other header file.

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>
int main ()
{
	double d;
	d = difftime (5,17);
	printf ("%.2f\n", d );
	return 0;
}

Select an option to see the answer and solution.

Select the right statement.

Select an option to see the answer and solution.

What will be the output of the following C code?
#include<time.h>
int main (void)
{
    float n = time(NULL);
    printf("%.2f\n" , n);
}

Select an option to see the answer and solution.

What will be the output of the following C code if the current system date is 6/22/2017?
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
int main()
{
    time_t ct;
    time(&ct);
    struct tm *mt=localtime(&ct);
    printf("%d\n",mt-> tm_mon+2);
}

Select an option to see the answer and solution.

What will be the output of the following C code, if the system date is 6/23/2017?
#include<stdio.h>
#include<time.h>
int main()
{
    struct tm *local;
    time_t t;
    t=time(NULL);
    local=localtime(&t);
    printf("%d",local->tm_mday);
    return 0;
}

Select an option to see the answer and solution.

The calloc() function allocates space for an array of n objects, each of whose size is defined by size. Space is initialized to all bits zero.

Select an option to see the answer and solution.

Select the macro that affects the information provided by localeconv function.

Select an option to see the answer and solution.

The value of CHAR_MAX will be equal to SCHAR_MAX when . . . . . . . .

Select an option to see the answer and solution.

Which of the given option is declared under the header file stdlib.h?

Select an option to see the answer and solution.

If access to the varying arguments is desired then the called function shall declare . . . . . . . . having type va_list.

Select an option to see the answer and solution.

The assert macro returns . . . . . . . . value.

Select an option to see the answer and solution.