Top 50+ Solved Managing IO Operations MCQ Questions Answer
Q. For a typical program, the input is taken using _________
a. scanf
b. Files
c. Command-line
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
Q. What is the default return-type of getchar()?
a. char
b. int
c. char *
d. reading character doesn’t require a return-type
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
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
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
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
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
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
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
Q. Which of the following macro extracts an argument from the variable argument list (ie ellipsis) and advancethe pointer to the next argument?
a. va_list
b. va_arg
c. va_end
d. va_start