Top

Library Functions

41.

What will the code display on compiling?

void funccall() 
{ 
   printf("this is funccall\n"); 
}  
void main () 
{   
    atexit(funccall); 
    printf("program starts\n");  
    printf("program ends\n");  
}

 

Answer: C

int atexit(void (*func)(void)) calls the specified function func when the program terminates. we can register termination function anywhere in the program, but it will be called at the time of the program termination.

Enter details here

42.

Which of the following functions returns a pointer to a string representing the date and time stored in a structure?

Answer: C

No answer description available for this question.

Enter details here

43.

It is necessary that for the string functions to work safely the strings must be terminated with '\0'.

Answer: A

C string is a character sequence stored as a one-dimensional character array and terminated with a null character('\0', called NULL in ASCII).
The length of a C string is found by searching for the (first) NULL byte.

Enter details here

44.

The macro definition of INT_MIN is ____________

Answer: A

No answer description available for this question.

Enter details here

45.

Point out the error in the following program.

#include
#include

int main()
{
    char str1[] = "Learn through Compscibits\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(str2, str1, 'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return 0;
}

 

Answer: D

No answer description available for this question.

Enter details here

46.

What will be the output of the program?

#include

int main()
{
    int i;
    char c;
    for(i=1; i<=5; i++)
    {
        scanf("%c", &c); /* given input is 'b' */
        ungetc(c, stdout);
        printf("%c", c);
        ungetc(c, stdin);
    }
    return 0;
}

 

Answer: C

No answer description available for this question.

Enter details here

47.

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

Answer: A

No answer description available for this question.

Enter details here

48.

_______variable type defined in the header stdlib.h is an integer type of the size of a wide character constant.

Answer: B

No answer description available for this question.

Enter details here

49.

Point out the error in the following program.

#include
#include

int main()
{
    char str1[] = "Learn through IndiaBIX\0.com",  str2[120];
    char *p;
    p = (char*) memccpy(str2, str1, 'i', strlen(str1));
    *p = '\0';
    printf("%s", str2);
    return 0;
}

 

Answer: D

No answer description available for this question.

Enter details here

50.

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

Answer: B

No answer description available for this question.

Enter details here

Loading…
Tags: Library Functions Questions and Answers || Library Functions MCQ Questions and Answers || Library Functions GK Questions and Answers || Library Functions GK MCQ Questions || Library Functions Multiple Choice Questions and Answers || Library Functions GK || GK on Library Functions || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming