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

12/13

Page

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

Some types and macros defined under the header file stddef.h may be defined under other header files too.

Select an option to see the answer and solution.

What will be the output of the following C code?
int main(void)
{
    int rc;
    rc = system("time");
    exit(0);
}

Select an option to see the answer and solution.

Which of the following statement is correct?
double x, y, z;
x = 5.123456;
z= modf(x, *y);

Select an option to see the answer and solution.

sqrt(x) function is not faster than the apparent equivalent pow(x,0.5).

Select an option to see the answer and solution.

Initial seed is . . . . . . . . for the function srand(unsigned int seed).

Select an option to see the answer and solution.

The value of tm_isdst is . . . . . . . . when DST( Daylight Savings Time) is in effect, . . . . . . . . when DST is not in effect and . . . . . . . . when the DST status is unknown.

Select an option to see the answer and solution.

The behavior is undefined if more than one call to the exit function is executed by a program.

Select an option to see the answer and solution.

What is the function of the given longjump(jmp_buf buf, i)?

Select an option to see the answer and solution.

Which of the given function is a library function under the header math.h?

Select an option to see the answer and solution.

Which header file is used to define data formats and currency symbols?

Select an option to see the answer and solution.

The three macros defined by stdarg.h is . . . . . . . .

Select an option to see the answer and solution.

. . . . . . . . macro must be called before using . . . . . . . . and . . . . . . . .

Select an option to see the answer and solution.

Point out the error (if any) in the following C code?
#include <stdlib.h>
#include <stdio.h>
int main(void)
{
    int* p = NULL;
    struct S *s = NULL;
    void(*f)(int, double) = NULL;
    char *ptr = malloc(15);
    if (ptr == NULL) printf("Out of memory");
    free(ptr);
}

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/2/2017 (Friday)?
#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,"%A",ptr);
    puts(str);
    return 0;
}

Select an option to see the answer and solution.

Which macro sets everything defined under locale. h?

Select an option to see the answer and solution.

The void longjmp( jmp-buf env, int val) function causes setjmp() macro to return . . . . . . . . value; if val is 0.

Select an option to see the answer and solution.

Which of the following functions is used to convert the date and time into a calendar format?

Select an option to see the answer and solution.

What does raise functions declared in signal.h do?

Select an option to see the answer and solution.

Which function converts the wide-character string to a multibyte string?

Select an option to see the answer and solution.

Select the macro that abnormally terminates the program.

Select an option to see the answer and solution.