Library Functions

16

What will be the output of the program?

#include<stdio.h>
#include<math.h>

int main()
{
    float i = 2.5;
    printf("%f, %d", floor(i), ceil(i));
    return 0;
}
A. 2, 3
B. 2.000000, 3
C. 2.000000, 0
D. 2, 0

17

What will be the output of the program?

#include<stdio.h>

int main()
{
    int i;
    i = printf("How r u\n");
    i = printf("%d\n", i);
    printf("%d\n", i);
    return 0;
}
A.
	How r u
        7
        2
B.
       How r u
       8
       2
C.
       How r u
       1
       1
D.
       Error: cannot assign printf to variable

18

What will the function randomize() do in Turbo C under DOS?

A. returns a random number.
B. returns a random number generator in the specified range.
C. returns a random number generator with a random value based on time.
D. return a random number with a given seed value.

19

Can you use the fprintf() to display the output on the screen?

A. Yes
B. No

20

What is the purpose of fflush() function.

A. flushes all streams and specified streams.
B. flushes only specified stream.
C. flushes input/output buffer.
D. flushes file buffer.