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);
}A. produces error
B. no value is returned
C. returns the time
D. nothing can be said
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);A. y stores integer part of x, z returns fractional part of x
B. y stores integer part of x, z returns integer part of x
C. y stores fractional part of x, z returns integer part of x
D. y stores fractional part of x, z returns fractional part of x
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.
A. -1, 1, 0
B. 1, 0, -1
C. 0, 1, -1
D. 1, -1, 0
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)?
A. go back to place buf is pointing to and return i
B. go back to place buf is pointing to and return 0
C. uses buf to remember current position and returns 0
D. uses buf to remember current position and returns i
Select an option to see the answer and solution.
Which of the given function is a library function under the header math.h?
A. log10()
B. log20()
C. log30()
D. log50()
Select an option to see the answer and solution.
Which header file is used to define data formats and currency symbols?
A. setjmp.h
B. locale.h
C. stdarg.h
D. assert.h
Select an option to see the answer and solution.
The three macros defined by stdarg.h is . . . . . . . .
A. start(), arg() and end()
B. var_start(), var_arg() and var_end()
C. va_start(), va_arg() and va_end()
D. v_start(), v_arg() and v_end()
Select an option to see the answer and solution.
. . . . . . . . macro must be called before using . . . . . . . . and . . . . . . . .
A. va_arg, va_end and va_start
B. va_start, va_end and va_arg
C. va_end, va_arg and va_start
D. v_arg, v_end and v_start
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);
}A. Error in the statement: void(*f)(int, double) = NULL;
B. Error in the statement: char *ptr = malloc(15);
C. Error in the statement: struct S*s = NULL;
D. No error
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?
A. LC_ALL
B. LC_COLLATE
C. LC_SET
D. LC_TIME
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.
A. zero
B. one
C. null
D. no return
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?
A. difftime()
B. clock()
C. mktime()
D. ctime()
Select an option to see the answer and solution.
What does raise functions declared in signal.h do?
A. reports a synchronous signal
B. let's you specify handling of signals
C. reports a asynchronous signal
D. doesn't let you specify handling of signals
Select an option to see the answer and solution.
Which function converts the wide-character string to a multibyte string?
A. wcstombs()
B. mbstowcs()
C. mbtowc()
D. mblen()
Select an option to see the answer and solution.
Select the macro that abnormally terminates the program.
A. SIGILL
B. SIGTERM
C. SIGABRT
D. SIGFPE
Select an option to see the answer and solution.