Top 50+ Solved Managing IO Operations MCQ Questions Answer

From 1 to 15 of 38

Q. Which among the following is the odd one out?

a. printf

b. fprintf

c. putchar

d. scanf

  • d. scanf

Q. For a typical program, the input is taken using _________

a. scanf

b. Files

c. Command-line

d. All of the mentioned

  • d. All of the mentioned

Q. What does the following command line signify? prog1prog2

a. It runs prog1 first, prog2 second

b. It runs prog2 first, prog1 second

c. It runs both the programs, pipes output of prog1 to input of prog2

d. It runs both the programs, pipes output of prog2 to input of prog1

  • c. It runs both the programs, pipes output of prog1 to input of prog2

Q. What is the default return-type of getchar()?

a. char

b. int

c. char *

d. reading character doesn’t require a return-type

  • b. int

Q. What is the value of EOF?

a. -1

b. 0

c. 1

d. 10

  • a. -1

Q. What is the use of getchar()?

a. The next input character each time it is called

b. EOF when it encounters end of file

c. The next input character each time it is called EOF when it encounters end of file

d. None of the mentioned

  • c. The next input character each time it is called EOF when it encounters end of file

Q. What is the return value of putchar()?

a. The character written

b. EOF if an error occurs

c. Nothing

d. Both character written & EOF if an error occurs

  • d. Both character written & EOF if an error occurs

Q. Escape sequences are prefixed with ________

a. %

b. /

c. ”

d. None of the mentioned

  • d. None of the mentioned

Q. What is the purpose of sprintf?

a. It prints the data into stdout

b. It writes the formatted data into a string

c. It writes the formatted data into a file

d. None of the mentioned

  • b. It writes the formatted data into a string

Q. What are the Properties of the first argument of a printf() functions?

a. It is defined by a user

b. It keeps the record of the types of arguments that will follow

c. There may no be first argument

d. None of the mentioned

  • b. It keeps the record of the types of arguments that will follow

Q. Which of the following function with ellipsis are illegal?

a. void func(…);

b. void func(int, …);

c. void func(int, int, …);

d. none of the mentioned

  • a. void func(…);

Q. Which of the following data-types are promoted when used as a parameter for an ellipsis?

a. char

b. short

c. int

d. none of the mentioned

  • a. char

Q. Which header file includes a function for variable number of arguments?

a. stdlib.h

b. stdarg.h

c. ctype.h

d. both stdlib.h and stdarg.h

  • a. stdlib.h
Subscribe Now

Get All Updates & News