Top 80+ Solved C Language MCQ Questions Answer

From 31 to 45 of 63

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. Which of the following statement is true?

a. The symbolic constant EOF is defined in <stdio.h>

b. The value is -1

c. The symbolic constant EOF is defined in <stdio.h> & value is -1

d. Only value is -1

  • c. The symbolic constant EOF is defined in <stdio.h> & value is -1

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

Q. The type va_list in an argument list is used ________

a. To declare a variable that will refer to each argument in turn;

b. For cleanup

c. To create a list

d. There is no such type

  • a. To declare a variable that will refer to each argument in turn;

Q. In a variable length argument function, the declaration “…” can _______

a. Appear anywhere in the function declaration

b. Only appear at the end of an argument list

c. Nothing

d. None of the mentioned

  • b. Only appear at the end of an argument list

Q. Each call of va_arg _______

a. Returns one argument

b. Steps va_list variable to the next

c. Returns one argument & Steps va_list variable to the next

d. None of the mentioned

  • c. Returns one argument & Steps va_list variable to the next
Subscribe Now

Get All Updates & News