MCQOPTIONS
Saved Bookmarks
This section includes 15 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. |
How many times the following program will print "Manjesh"? |
| A. | Infinite number of times |
| B. | 32767 times |
| C. | 65535 times |
| D. | Till the stack doesn't overflow |
| Answer» E. | |
| 2. |
Which function is responsible for searching in the table? (For #define IN 1, the name IN and replacement text 1 are stored in a table ) |
| A. | find(s); |
| B. | findout(s); |
| C. | lookfor(s); |
| D. | lookup(s); |
| E. | None of these |
| Answer» E. None of these | |
| 3. |
Which function is responsible for recording the name n and the replacement text t in a table? |
| A. | setup(n, t); |
| B. | settle(n, t); |
| C. | install(n, t); |
| D. | fix(n, t); |
| E. | None of these |
| Answer» D. fix(n, t); | |
| 4. |
The standard header _______ is used for variable list arguments ( ) in C. |
| A. | <stdarg.h> |
| B. | <math.h> |
| C. | <stdlib.h> |
| D. | <stdio.h> |
| E. | None of these |
| Answer» B. <math.h> | |
| 5. |
Each call of va_arg _______. |
| A. | Returns multiple argument |
| B. | Returns one argument |
| C. | Steps va_list variable to the next |
| D. | Returns one argument & Steps va_list variable to the next |
| E. | None of these |
| Answer» E. None of these | |
| 6. |
In a variable length argument function, the declaration can _______ |
| A. | Nothing |
| B. | Appear anywhere in the function declaration |
| C. | Only appear at the end of an argument list |
| D. | All of above |
| E. | None of these |
| Answer» D. All of above | |
| 7. |
The type va_list in an argument list is used ________. |
| A. | There is no such type |
| B. | To create a list |
| C. | For cleanup |
| D. | To declare a variable that will refer to each argument in turn; |
| E. | None of these |
| Answer» C. For cleanup | |
| 8. |
Which of the following is true for "call by value" in C? |
| A. | Called function has access to original argument |
| B. | Called function creates a local copy of the passed argument |
| C. | Both A and B are true |
| D. | None of the above |
| Answer» C. Both A and B are true | |
| 9. |
Which of the following is true for "call by reference" in C program? |
| A. | Called function can alter the value of variable passed from calling function |
| B. | Called function creates a private temporary copy of the passed argument and modifies it. |
| C. | Both A and B are false |
| D. | A is true |
| Answer» B. Called function creates a private temporary copy of the passed argument and modifies it. | |
| 10. |
What error will the following function give on compilation? |
| A. | Missing parentheses in return statement |
| B. | The function should be defined as int fun(int x, int y ) |
| C. | Re declaration of x |
| D. | None of the above |
| Answer» D. None of the above | |
| 11. |
Which of the following statements are correct about the following program? |
| A. | It prints "main" infinite number of times. |
| B. | It runs an infinite loop without printing anything. |
| C. | Compiler report an error since main() cannot be called recursively. |
| D. | Address of main( ) would get printed infinite number of times. |
| E. | Address of main( ) would get printed once. |
| Answer» F. | |
| 12. |
What is the problem in the following C declarations? |
| A. | A function with same name cannot have different return types |
| B. | A function with same name cannot have different number of parameters |
| C. | A function with same name cannot have different signatures |
| D. | All of above |
| E. | None of these |
| Answer» E. None of these | |
| 13. |
What will be the data type returned for the following C function? |
| A. | char |
| B. | double |
| C. | multiple type-casting in return is illegal |
| D. | float |
| E. | int |
| Answer» F. | |
| 14. |
What will be the output of the following C code having void return-type function? |
| A. | 5 |
| B. | 4 |
| C. | Compilation Error |
| D. | Runtime Error |
| E. | None of these |
| Answer» D. Runtime Error | |
| 15. |
Can we use a function as a parameter of another function? [ Eg: void funA(int funB()) ]. |
| A. | This case is compiler dependent |
| B. | Yes, and we can use the function value conveniently |
| C. | Yes, but we call the function again to get the value, not as convenient as in using variable |
| D. | No, C does not support it |
| E. | None of these |
| Answer» E. None of these | |