

MCQOPTIONS
Saved Bookmarks
This section includes 35 Mcqs, each offering curated multiple-choice questions to sharpen your C Programming knowledge and support exam preparation. Choose a topic below to get started.
1. |
is an array that holds information needed by and |
A. | True |
B. | False |
Answer» B. False | |
2. |
The macro is used to initialise a pointer to the beginning of the list of fixed arguments. |
A. | True |
B. | False |
Answer» C. | |
3. |
The macro is used to extract an argument from the fixed micro argument list and advance the pointer to the next argument. |
A. | Yes |
B. | No |
Answer» C. | |
4. |
It is necessary to call the macro if is called in the function. |
A. | Yes |
B. | No |
Answer» B. No | |
5. |
The macro is used to extract an argument from the variable argument list and advance the pointer to the next argument. |
A. | True |
B. | False |
Answer» B. False | |
6. |
A function that receives variable number of arguments should use to extract arguments from the variable argument list. |
A. | True |
B. | False |
Answer» B. False | |
7. |
A function that receives variable number of arguments should use to extract the last argument from the variable argument list. |
A. | True |
B. | False |
Answer» C. | |
8. |
Point out the error in the following program._x000D_
#include
|
A. | Error: invalid va_list declaration |
B. | Error: var c data type mismatch |
C. | No error |
D. | No error and Nothing will print |
Answer» C. No error | |
9. |
Which header file should you include, if you are going to develop a function, which can accept variable number of arguments? |
A. | varagrg.h |
B. | stdlib.h |
C. | stdio.h |
D. | stdarg.h |
Answer» E. | |
10. |
The macro va_arg is used to extract an argument from the fixed micro argument list and advance the pointer to the next argument. |
A. | Yes |
B. | No |
Answer» C. | |
11. |
Point out the error in the following program.
#include
|
A. | Error: too many parameters |
B. | Error: invalid access to list member |
C. | Error: ptr must be type of va_list |
D. | No error |
Answer» D. No error | |
12. |
The macro va_start is used to initialise a pointer to the beginning of the list of fixed arguments. |
A. | 1 |
B. | |
Answer» C. | |
13. |
It is necessary to call the macro va_end if va_start is called in the function. |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» B. No | |
14. |
A function that receives variable number of arguments should use va_arg() to extract the last argument from the variable argument list. |
A. | 1 |
B. | |
Answer» C. | |
15. |
Is it necessary that in a function which accepts variable argument list there should be at least be one fixed argument? |
A. | Yes |
B. | No |
Answer» B. No | |
16. |
A function that receives variable number of arguments should use va_arg() to extract arguments from the variable argument list. |
A. | 1 |
B. | |
Answer» B. | |
17. |
Point out the error if any in the following program (Turbo C).
#include
|
A. | Error: unknown variable ptr |
B. | Error: Lvalue required for parameter |
C. | No error and print A a b c |
D. | No error and print 4 A a b c |
Answer» D. No error and print 4 A a b c | |
18. |
Point out the error in the following program.
#include
|
A. | Error: invalid function display() call |
B. | Error: invalid function show() call |
C. | No error |
D. | Error: Rvalue required for t |
Answer» C. No error | |
19. |
va_list is an array that holds information needed by va_arg and va_end |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |
20. |
Point out the error in the following program.
#include
|
A. | Error: invalid va_list declaration |
B. | Error: var c data type mismatch |
C. | No error |
D. | No error and Nothing will print |
Answer» C. No error | |
21. |
For a function receives variable number of arguments it is necessary that the function should receive at least one fixed argument. |
A. | 1 |
B. | |
Answer» B. | |
22. |
Can we write a function that takes a variable argument list and passes the list to another function? |
A. | Yes |
B. | No |
Answer» B. No | |
23. |
Point out the error in the following program.
#include
|
A. | Error: ptr has to be set at begining |
B. | Error: ptr must be type of va_list |
C. | Error: invalid access to list member |
D. | No error |
Answer» B. Error: ptr must be type of va_list | |
24. |
In a function that receives variable number of arguments the fixed arguments passed to the function can be at the end of argument list. |
A. | 1 |
B. | |
Answer» C. | |
25. |
While defining a variable argument list function we drop the ellipsis(...)? |
A. | Yes |
B. | No |
Answer» B. No | |
26. |
Point out the error in the following program.
#include
|
A. | Error: invalid arguments in function display() |
B. | Error: too many parameters |
C. | Error: in va_start(ptr, s); |
D. | No error |
Answer» D. No error | |
27. |
Can the fixed arguments passed to the function that accepts variable argument list, occur at the end? |
A. | Yes |
B. | No |
Answer» C. | |
28. |
What will be the output of the program?
#include
|
A. | A 10 3.14 A 10 3.14 |
B. | A 10 10 3.140000 Hello A 10 10 3.140000 Hello |
C. | A 10 Hello A 10 Hello |
D. | Error |
Answer» C. A 10 Hello A 10 Hello | |
29. |
Can we pass a variable argument list to a function at run-time? |
A. | Yes |
B. | No |
C. | Yes |
D. | No |
Answer» C. Yes | |
30. |
Point out the error in the following program.
#include
|
A. | Error: fun() needs return type |
B. | Error: ptr Lvalue required |
C. | Error: Invalid declaration of fun(...) |
D. | No error |
Answer» D. No error | |
31. |
The macro va_arg is used to extract an argument from the variable argument list and advance the pointer to the next argument. |
A. | 1 |
B. | |
C. | 1 |
D. | |
Answer» B. | |
32. |
What will be the output of the program?
#include
|
A. | Dogs 12 |
B. | Cats 14 |
C. | Boys 13 |
D. | Apple 12 |
Answer» E. | |
33. |
What will be the output of the program?
#include
|
A. | 2 4 3 6 |
B. | 2 4 8 3, 6, 9, 7 |
C. | 4 8 6 9 7 |
D. | 1 1 1 1 1 1 1 |
Answer» D. 1 1 1 1 1 1 1 | |
34. |
What will be the output of the program?
#include
|
A. | A, AB, BC, CD, D |
B. | A, aB, bC, cD, d |
C. | A, 65B, 66C, 67D, 68 |
D. | A, 0B, 0C, 0C, 0 |
Answer» D. A, 0B, 0C, 0C, 0 | |
35. |
What will be the output of the program?
#include
|
A. | IndiaBIX 1 7 11 0 |
B. | 1 |
C. | 4 |
D. | 7 |
Answer» D. 7 | |