Top

Library Functions

31.

Determine Output:

#include
#define a 10
void main()
{
      #define a 50
      printf("%d", a);
}

 

Answer: A

No answer description available for this question.

Enter details here

32.

The header file assert.h of the C Standard Library defines ________macro.

Answer: D

No answer description available for this question.

Enter details here

33.

Data written into a file using fwrite() can be read back using fscanf()

Answer: B

fwrite() - Unformatted write in to a file.
fscanf() - Formatted read from a file.

Enter details here

34.

The itoa function can convert an integer in decimal, octal or hexadecimal form to a string.

Answer: A

No answer description available for this question.

Enter details here

35.

MB_CUR_MAX is not defined in stdlib.h.

Answer: B

No answer description available for this question.

Enter details here

Answer: B

No answer description available for this question.

Enter details here

37.

Will the program outputs "IndiaBIX.com"?

#include
#include

int main()
{
    char str1[] = "IndiaBIX.com";
    char str2[20];
    strncpy(str2, str1, 8);
    printf("%s", str2);
    return 0;
}

 

Answer: B

No. It will print something like 'IndiaBIX(some garbage values here)' .

Because after copying the first 8 characters of source string into target string strncpy() doesn't terminate the target string with a '\0'. So it may print some garbage values along with IndiaBIX.

Enter details here

38.

If the two strings are found to be unequal then strcmp returns difference between the first non-matching pair of characters.

Answer: A

No answer description available for this question.

Enter details here

39.

The assert macro returns__________value.

Answer: D

No answer description available for this question.

Enter details here

Answer: B

void free(void *p);
This function de-allocates space to which p points(if p is not NULL).

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