Top

Library Functions

61.

What will be the output of the program?

#include

int main()
{
    int i;
    i = scanf("%d %d", &i, &i);
    printf("%d\n", i);
    return 0;
}

 

Answer: B

scanf() returns the number of variables to which you are provding the input.

i = scanf("%d %d", &i, &i); Here Scanf() returns 2. So i = 2.

printf("%d\n", i); Here it prints 2.

Enter details here

62.

The source filename and line number come from the preprocessor macros________and______

Answer: A

No answer description available for this question.

Enter details here

Answer: C

The standard error(stderr) stream is the default destination for error messages and other diagnostic warnings. Like stdout, it is usually also directed to the output device of the standard console (generally, the screen).

Enter details here

64.

What will be the output of the program?

#include

int main()
{
    int i;
    i = printf("How r u\n");
    i = printf("%d\n", i);
    printf("%d\n", i);
    return 0;
}

 

Answer: B

In the program, printf() returns the number of charecters printed on the console

i = printf("How r u\n"); This line prints "How r u" with a new line character and returns the length of string printed then assign it to variable i.
So i = 8 (length of '\n' is 1).

i = printf("%d\n", i); In the previous step the value of i is 8. So it prints "8" with a new line character and returns the length of string printed then assign it to variable i. So i = 2 (length of '\n' is 1).

printf("%d\n", i); In the previous step the value of i is 2. So it prints "2".

Enter details here

65.

Which of the given function differs from the statement'errno is not neccessarily set on conversion error'?

Answer: D

No answer description available for this question.

Enter details here

66.

mblen() function returns 0,if a null wide character was recognized. It returns -1 if an invalid multi-byte sequence was encountered.

Answer: A

No answer description available for this question.

Enter details here

67.

The mbstowcs() function is used to return the number of array elements modified, not including a terminating zero code, if any.

Answer: A

No answer description available for this question.

Enter details here

68.

Input/output function prototypes and macros are defined in which header file?

Answer: C

stdio.h, which stands for "standard input/output header", is the header in the C standard library that contains macro definitions, constants, and declarations of functions and types used for various standard input and output operations.

Enter details here

69.

Which function is used to recombine the fraction and exponent parts of a floating-point value after you have worked on them separately?

Answer: D

No answer description available for this question.

Enter details here

Answer: A

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