Top 80+ Solved C Language MCQ Questions Answer
Q. The standard header _______ is used for variable list arguments (…) in C.
a. <stdio.h >
b. <stdlib.h>
c. <math.h>
d. <stdarg.h>
Q. What is the purpose of va_end?
a. Cleanup is necessary
b. Must be called before the program returns
c. Cleanup is necessary & Must be called before the program returns
d. None of the mentioned
Q. Which of the following is NOT a delimiter for an input in scanf?
a. Enter
b. Space
c. Tab
d. None of the mentioned
Q. If the conversion characters of int d, i, o, u and x are preceded by h, it indicates?
a. A pointer to int
b. A pointer to short
c. A pointer to long
d. A pointer to char
Q. Which of the following doesn’t require an & for the input in scanf()?
a. char name[10];
b. int name[10];
c. float name[10];
d. all of the mentioned
Q. Which of the following is an invalid method for input?
a. scanf(“%d%d%d”,&a, &b, &c);
b. scanf(“%d %d %d”, &a, &b, &c);
c. scanf(“Three values are %d %d %d”,&a,&b,&c);
d. none of the mentioned
Q. Which of the following represents the function for scanf()?
a. void scanf(char *format, …)
b. int scanf(char *format, …)
c. char scanf(int format, …)
d. char *scanf(char *format, …)
Q. What does scanf() function return?
a. Number of successfully matched and assigned input items
b. Nothing
c. Number of characters properly printed
d. Error
Q. The conversion characters d, i, o, u, and x may be preceded by h in scanf() to indicate?
a. A pointer to short
b. A pointer to long
c. Nothing
d. Error
Q. The syntax of printf() function is printf(“control string”, variable list) ;what is the prototype of the controlstring?
a. %[flags][.precision][width][length]specifier
b. %[flags][length][width][.precision]specifier
c. %[flags][width][.precision][length]specifier
d. %[flags][.precision][length][width]specifier
Q. The parameter control string in the printf () is a C String that contains text to be __________
a. taken from a standard output device
b. written on to the standard output device
c. received from the standard output device
d. nothing can be said
Q. Output justification such as decimal point, numerical sign, trailing zeros or octal are specified.
a. specifier
b. flags
c. precision
d. decimal
Q. What error will be generated on using incorrect specifier for the datatype being read?
a. compile error
b. run-time error
c. logical error
d. no error
Q. What is the prototype of scanf function?
a. scanf("controlstring",arg1,arg2,arg3,….,argn);
b. scanf("control string", variable list);
c. scanf(" varible list,", control string);
d. scanf("arg1,arg2,arg3,….,argn", control string);
Q. What is the meaning of the following C statement? scanf("%[^\n]s", ch);
a. read all character except new line
b. read all characters
c. read only new line character
d. syntax error