MCQOPTIONS
Saved Bookmarks
This section includes 172 Mcqs, each offering curated multiple-choice questions to sharpen your Maharashtra CET knowledge and support exam preparation. Choose a topic below to get started.
| 51. |
What is the output of this C code (without linking the source file in which ary1 is defined)? |
| A. | scope rules |
| B. | Linking error due to undefined reference |
| C. | Compile time error because size of array is not provided |
| D. | Compile time error because datatype of array is not provided |
| Answer» B. Linking error due to undefined reference | |
| 52. |
Which variable has the longest scope? |
| A. | a |
| B. | b |
| C. | c |
| D. | Both a and b |
| Answer» C. c | |
| 53. |
Comment on the output of this 2 C code? |
| A. | They are both the same |
| B. | Scope of C is till the end of program |
| C. | All operation in Program 1 can also be performed in Program 2 |
| D. | None of the mentioned |
| Answer» D. None of the mentioned | |
| 54. |
The sequence of allocation and deletion of variables for the following code is. |
| A. | a->b, a->b |
| B. | a->b, b->a |
| C. | b->a, a->b |
| D. | b->a, b->a |
| Answer» C. b->a, a->b | |
| 55. |
What is the output of code given below if these two files are linked and run in file test.c ? |
| A. | 1 0 0 |
| B. | 0 0 |
| C. | 10 10 |
| D. | None of the mentioned |
| Answer» E. | |
| 56. |
Assignment statements assigning value to local static variables are executed only once |
| A. | true |
| B. | false |
| C. | Depends on the code |
| D. | None of the mentioned |
| Answer» C. Depends on the code | |
| 57. |
Comment on the output of this C code? |
| A. | Output will be 0 |
| B. | Output will be 20 |
| C. | Output will be a garbage value |
| D. | Compile time error due to redeclaration of static variable |
| Answer» B. Output will be 20 | |
| 58. |
Inner Block can access variables declared ___________. |
| A. | inside Outer Block |
| B. | None of these |
| C. | inside Same Block |
| D. | inside Inner Block |
| Answer» B. None of these | |
| 59. |
Pick the correct statements. |
| A. | I and II |
| B. | I and III |
| C. | II and III |
| D. | II anf IV |
| Answer» D. II anf IV | |
| 60. |
Automatic variables |
| A. | Exist only within that scope in which it is declared |
| B. | Cease to exist after the block is exited |
| C. | Exist only within that scope in which it is declared & exist after the block is exited |
| D. | Only 1 |
| Answer» D. Only 1 | |
| 61. |
What is the problem in the following declarations? int func(int); double func(int); int func(float); |
| A. | A function with same name cannot have different signatures |
| B. | A function with same name cannot have different return types |
| C. | A function with same name cannot have different number of parameters |
| D. | All of the mentioned |
| Answer» E. | |
| 62. |
A function can make |
| A. | One throw |
| B. | One throw of each scale type |
| C. | One throw of each programmerdefined type |
| D. | As many throws of as many types as necessary |
| Answer» E. | |
| 63. |
The #elif directive cannot appear after the preprocessor #else directive |
| A. | True |
| B. | False |
| C. | None of the mentioned |
| D. | Varies |
| Answer» B. False | |
| 64. |
The “else if” in conditional inclusion is written by? |
| A. | #else if |
| B. | #elseif |
| C. | #elsif |
| D. | #elif |
| Answer» E. | |
| 65. |
Which conversion also called Automatic Type Conversion? |
| A. | Implicit Type Conversion |
| B. | Explicit Type Conversion |
| C. | both a and b |
| D. | None of the above |
| Answer» B. Explicit Type Conversion | |
| 66. |
Iteration requires more system memory than recursion. |
| A. | True |
| B. | False |
| C. | May be True or False |
| D. | Can't Say |
| Answer» C. May be True or False | |
| 67. |
Which function definition will run correctly? |
| A. | int sum(int a, int b) return (a + b); |
| B. | int sum(int a, int b) {return (a + b);} |
| C. | int sum(a, b) return (a + b); |
| D. | none of the mentioned |
| Answer» C. int sum(a, b) return (a + b); | |
| 68. |
A preprocessor is a program |
| A. | That processes its input data to produce output that is used as input to another program |
| B. | That is nothing but a loader |
| C. | That links various source files |
| D. | All of the mentioned |
| Answer» B. That is nothing but a loader | |
| 69. |
In the following 'C' code, in which order the functions would be called ? a = ( f1(23,14 ) * f2 (12/14)) + f3 () ; |
| A. | f1,f2,f3 |
| B. | f3,f2,f1 |
| C. | The order may vary from compiler to compiler |
| D. | None of these |
| Answer» B. f3,f2,f1 | |
| 70. |
Global variables are: |
| A. | Internal |
| B. | External |
| C. | Both Internal and External |
| D. | None of the mentioned |
| Answer» C. Both Internal and External | |
| 71. |
The value obtained in the function is given back to main by using ________ keyword? |
| A. | return |
| B. | static |
| C. | new |
| D. | volatile |
| Answer» B. static | |
| 72. |
Let a, b be two non-negative integers. Which of the following calls, finds the positive difference of a and b ? |
| A. | find(a, b) + find (b, a) |
| B. | find (a, find(a, b)) |
| C. | a + find (a, b) |
| D. | b + find(a, b) |
| Answer» B. find (a, find(a, b)) | |
| 73. |
Which of the following function declaration is illegal? |
| A. | double func(); int main(){} double func(){} |
| B. | double func(){}; int main(){} |
| C. | int main() { double func(); } double func(){//statements} |
| D. | None of the mentioned |
| Answer» E. | |
| 74. |
What is the sequence for preprocessor to look for the file within ? |
| A. | The predefined location then the current directory |
| B. | The current directory then the predefined location |
| C. | The predefined location only |
| D. | The current directory location |
| Answer» B. The current directory then the predefined location | |
| 75. |
If max is a function that returns the larger of the two integers, given as arguments, then which of the following statements finds the largest of three given numbers |
| A. | max(max(a,b),max (a,c)) |
| B. | max(max(a,b),max (b,c)) |
| C. | max(b,max (a,c)) |
| D. | All of these |
| Answer» E. | |
| 76. |
A function that uses variable types is called |
| A. | Overloaded |
| B. | Template Function |
| C. | Variable function |
| D. | Virtual function |
| Answer» D. Virtual function | |
| 77. |
void can be used |
| A. | as a data-type of a function that returns nothing to its calling environment |
| B. | inside the brackets of a function that does not need any argument |
| C. | in an expression |
| D. | both (a) & (b) |
| Answer» E. | |
| 78. |
A function that is prototyped as double calculate (int, num);may |
| A. | Receive an integer constant such as 12 |
| B. | Receive an integer variable |
| C. | Either (a) or (b) |
| D. | None of these |
| Answer» C. Either (a) or (b) | |
| 79. |
Can we use a function as a parameter of another function? |
| A. | Yes, and we can use the function value conveniently |
| B. | Yes, but we call the function again to get the value, not as convenient as in using variable |
| C. | No, C does not support it |
| D. | This case is compiler dependent |
| Answer» D. This case is compiler dependent | |
| 80. |
If the file name is enclosed in double quotation marks |
| A. | The preprocessor treats it as a user-defined file |
| B. | The preprocessor treats it as a system-defined file |
| C. | The preprocessor treats it as a user-defined file & system-defined file |
| D. | None of the mentioned |
| Answer» B. The preprocessor treats it as a system-defined file | |
| 81. |
Which of the following properties of #define not true? |
| A. | You can use a pointer to #define |
| B. | #define can be made externally available |
| C. | They obey scope rules |
| D. | All of the mentioned |
| Answer» E. | |
| 82. |
Which of the following sequences are unaccepted in C language?a) #if #else #endifb) #if #elif #endifc) #if #if #endifd) #if #undef #endif |
| A. | a |
| B. | b |
| C. | c |
| D. | d |
| Answer» D. d | |
| 83. |
C preprocessors can have compiler specific features |
| A. | true |
| B. | false |
| C. | Depends on the standard |
| D. | Depends on the platform |
| Answer» B. false | |
| 84. |
Property of external variable to be accessed by any source file is called by C90 standard as |
| A. | external linkage |
| B. | external scope |
| C. | global scope |
| D. | global linkage |
| Answer» B. external scope | |
| 85. |
Feature for accessing a variable through its address is desireable because |
| A. | call by reference can be simulated |
| B. | excessive use of global variables can be avoided |
| C. | a function can return more than one value |
| D. | All of the above |
| Answer» E. | |
| 86. |
When a recursive function is called in the absence of an exit condition, it results in an infinite loop due to which the stack keeps getting filled(stack overflow). This results in a run time error. |
| A. | True |
| B. | False |
| C. | May be True or False |
| D. | Can't Say |
| Answer» B. False | |
| 87. |
In Implicit type conversion, If an operand of long int is present then the other operand will be converted to |
| A. | unsigned int |
| B. | unsigned long int |
| C. | float |
| D. | long int |
| Answer» E. | |
| 88. |
The process in which a function calls itself directly or indirectly is called |
| A. | Recursion |
| B. | Type Conversions |
| C. | Constant |
| D. | Abstract Classes |
| Answer» B. Type Conversions | |
| 89. |
Register storage class can be specified to global variables |
| A. | true |
| B. | false |
| C. | Depends on the compiler |
| D. | Depends on the standard |
| Answer» C. Depends on the compiler | |
| 90. |
The function is lower(char) checks whether a character is in lower case or not, therefore it should return |
| A. | 0 or 1 |
| B. | -1,0 or 1 |
| C. | a character |
| D. | nothing |
| Answer» B. -1,0 or 1 | |
| 91. |
Pick the correct statements.I. The body of a function should have only one return statement.II. The body of a function may have many return statements.III. A function can return only one value to the calling environment.IV. If return statement is omitted, then the function does its job but returns no value to the calling environment. |
| A. | I and II |
| B. | I and III |
| C. | II and III |
| D. | II and IV |
| Answer» D. II and IV | |
| 92. |
Which among the following is wrong for “register int a;” ? |
| A. | Compiler generally ignores the request |
| B. | You cannot take the address of this variable |
| C. | Access time to a is critical |
| D. | None of the mentioned |
| Answer» E. | |
| 93. |
Which of the following is/are syntactically correct? |
| A. | for ( ) ; |
| B. | f or (;) ; |
| C. | for ( , ); |
| D. | for ( ; ; ) ; |
| Answer» E. | |
| 94. |
Functions in C are ALWAYS: |
| A. | Internal |
| B. | External |
| C. | Both Internal and External |
| D. | External and Internal are not valid terms for functions |
| Answer» C. Both Internal and External | |
| 95. |
Which of the following is true about recursion? |
| A. | Recursion provides a clean and simple way to write code. |
| B. | The recursive program has less space requirements than iterative program |
| C. | The principle of stack is FIFO |
| D. | All of the above |
| Answer» B. The recursive program has less space requirements than iterative program | |
| 96. |
When a function is recursively called all the automatic variables are stored in a .......... |
| A. | Stack |
| B. | Queue |
| C. | Array |
| D. | Linked list |
| Answer» B. Queue | |
| 97. |
It is not advisable to use macros instead of functions because |
| A. | it increases the code size |
| B. | no type checking will be done |
| C. | recursion is not possible |
| D. | All of the above |
| Answer» E. | |
| 98. |
In Implicit type conversion, If an operand of type long double is present in the expression, then the corresponding operand will also be converted to |
| A. | double |
| B. | long double |
| C. | int |
| D. | float |
| Answer» C. int | |
| 99. |
A function fun is called __________ if it calls the same function fun. |
| A. | indirect recursive |
| B. | direct recursive |
| C. | both a and b |
| D. | None of the above |
| Answer» C. both a and b | |
| 100. |
When any function is called from main(), the memory is allocated to it on the stack. |
| A. | True |
| B. | False |
| C. | May be True or False |
| D. | Can't Say |
| Answer» B. False | |