

McqMate
These multiple-choice questions (MCQs) are designed to enhance your knowledge and understanding in the following areas: Programming Languages , Master of Science in Software Engineering (MSc SE) .
51. |
The statement i++; is equivalent to |
A. | i = i + i; |
B. | i = i + 1; |
C. | i = i – 1; |
D. | i –; |
Answer» A. i = i + i; |
52. |
In C language, a hexadecimal number is represented by writing |
A. | x |
B. | xo |
C. | ox |
D. | h |
Answer» B. xo |
53. |
Which of the following library function below by default aborts the program? |
A. | terminate() |
B. | end() |
C. | abort() |
D. | exit() |
Answer» C. abort() |
54. |
If a member needs to have unique value for all the objects of that same class, declare the member as |
A. | global variable outside class |
B. | local variable inside constructor |
C. | static variable inside class |
D. | dynamic variable inside class |
Answer» A. global variable outside class |
55. |
Value of ix+j, if i,j are integer type and ix long type would be |
A. | integer |
B. | float |
C. | long integer |
D. | double percision |
Answer» B. float |
56. |
Which of the following below can perform conversions between pointers to related classes? |
A. | cast_static |
B. | dynamic_cast |
C. | static_cast |
D. | cast_dynamic |
Answer» C. static_cast |
57. |
How do we define a constructor? |
A. | x~() {} |
B. | x() {}~ |
C. | x() ~{} |
D. | ~x() {} |
Answer» C. x() ~{} |
58. |
Vtables |
A. | creates a static table per class |
B. | creates a static table per object |
C. | creates a dynamic table per class |
D. | creates a dynamic table per object |
Answer» D. creates a dynamic table per object |
59. |
When class B is inherited from class A, what is the order in which the constructers of those classes are called |
A. | class a first class b next |
B. | class b first class a next |
C. | class b’s only as it is the child class |
D. | class a’s only as it is the parent class |
Answer» A. class a first class b next |
60. |
Which of the following is the most general exception handler that catches exception of any type? |
A. | catch(std::exception) |
B. | catch(std::any_exception) |
C. | catch(…) |
D. | catch() |
Answer» A. catch(std::exception) |
61. |
Which of the following is the most general exception handler that catches exception of ‘any type’? |
A. | catch(std::exception) |
B. | catch(std::any_exception) |
C. | catch(…) |
D. | catch() |
Answer» C. catch(…) |
62. |
In a group of nested loops, which loop is executed the most number of times? |
A. | the outermost loop |
B. | the innermost loop |
C. | all loops are executed the same number of times |
D. | cannot be determined without knowing the size of the loops |
Answer» C. all loops are executed the same number of times |
63. |
What is the Difference between struct and class in terms of Access Modifier? |
A. | by default all the struct members are private while by default class members are public. |
B. | by default all the struct members are protected while by default class members are private. |
C. | by default all the struct members are public while by default class members are private. |
Answer» B. by default all the struct members are protected while by default class members are private. |
64. |
Inline functions are invoked at the time of |
A. | run time |
B. | compile time |
C. | depends on how it is invoked |
D. | both b and c above |
Answer» C. depends on how it is invoked |
65. |
What is shallow copy? |
A. | a shallow copy creates a copy of the dynamically allocated objects too. |
B. | a shallow copy just copies the values of the data as they are. |
C. | a shallow copy creates a copy of the statically allocated objects too |
D. | both b and c above |
Answer» B. a shallow copy just copies the values of the data as they are. |
66. |
What is deep copy? |
A. | a deep copy creates a copy of the dynamically allocated objects too. |
B. | a deep copy just copies the values of the data as they are. |
C. | a deep copy creates a copy of the statically allocated objects too |
D. | both b and c above |
Answer» B. a deep copy just copies the values of the data as they are. |
67. |
Which of the following below is /are a valid iterator type? |
A. | input iterator |
B. | backward iterator |
C. | forward iterator |
D. | both a and c above |
Answer» A. input iterator |
68. |
What defines a general set of operations that will be applied to various types of data? |
A. | template class |
B. | function template |
C. | class template |
D. | both a and c above |
Answer» D. both a and c above |
69. |
Under which of the following circumstances, synchronization takes place? |
A. | when the file is closed |
B. | when the buffer is empty |
C. | explicitly, with manipulators |
D. | both a and c |
Answer» B. when the buffer is empty |
70. |
Which of the following functions below can be used Allocate space for array in memory? |
A. | calloc() |
B. | malloc() |
C. | realloc() |
D. | both a and b |
Answer» D. both a and b |
71. |
Statement scanf(“%d”,80); |
A. | assign an integer to variable i |
B. | give an error message |
C. | print the value of i |
D. | assign an float to variable i |
Answer» A. assign an integer to variable i |
72. |
STL is based on which of the following programming paradigms? |
A. | structured programming |
B. | object oriented programming (oop) |
C. | functional programming |
D. | aspect oriented programming (aop) |
Answer» A. structured programming |
73. |
Which of the following is not a component of file system |
A. | access method |
B. | auxiliary storage management |
C. | free integrity mechanism |
D. | none of the above |
Answer» C. free integrity mechanism |
74. |
If there is more than one statement in the block of a for loop, which of the following must be placed at the beginning and the ending of the loop block? |
A. | parentheses ( ) |
B. | braces { } |
C. | brackets [ ]. |
D. | arrows < > |
Answer» B. braces { } |
75. |
Which of the following members do get inherited but become private members in child class |
A. | public |
B. | private |
C. | protected |
D. | all the above |
Answer» B. private |
76. |
Which looping process is best used when the number of iterations is known? |
A. | for |
B. | while |
C. | do-while |
D. | all looping processes require that the iterations be known |
Answer» C. do-while |
77. |
In a C language ‘3’ represents |
A. | a digit |
B. | an integer |
C. | a character |
D. | a word |
Answer» A. a digit |
78. |
Which of the following is the most common way of implementing C++? |
A. | c++ programs are directly compiled into native code by a compiler |
B. | c++ programs are first compiled to intermediate code by a compiler and then executed by a virtual machine |
C. | c++ programs are interpreted by an interpreter |
D. | a c++ editor directly compiles and executes the program |
Answer» C. c++ programs are interpreted by an interpreter |
79. |
Which of the following operators can be implemented as a nonmember operator? |
A. | - (addition operator) |
B. | () (function call operator) |
C. | [. (array access operator) |
D. | + (addition operator) |
Answer» C. [. (array access operator) |
80. |
What is the implicit pointer that is passed as the first argument for nonstatic member functions? |
A. | ‘self’ pointer |
B. | std::auto_ptr pointer |
C. | ‘myself’ pointer |
D. | ‘this’ pointer |
Answer» D. ‘this’ pointer |
81. |
Which of the following operators can be overloaded? |
A. | . (dot or member access operator) |
B. | & (address-of operator) |
C. | sizeof operator |
D. | ?: (conditional operator) |
Answer» D. ?: (conditional operator) |
82. |
Which of the following operators below allow to define the member functions of a class outside the class? |
A. | :: |
B. | ? |
C. | ?? |
D. | % |
Answer» D. % |
83. |
Which of the following is not a valid conditional inclusions in preprocessor directives |
A. | #ifdef |
B. | #ifundef |
C. | #endif |
D. | #elif |
Answer» A. #ifdef |
84. |
Value of a in a = (b = 5, b + 5); is |
A. | junk value |
B. | syntax error |
C. | 5 |
D. | 10 |
Answer» B. syntax error |
85. |
Minimum number of temporary variable needed to swap the contents of 2 variables is: |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 0 |
Answer» D. 0 |
86. |
How to declare operator function? |
A. | operator operator sign |
B. | operator |
C. | operator sign |
D. | none of the mentioned |
Answer» A. operator operator sign |
87. |
xample obj = new Example (1,2,3); |
A. | constructor 2 |
B. | constructor 4 |
C. | constrcutor 1 |
D. | type mismatch error |
Answer» B. constructor 4 |
Done Studing? Take A Test.
Great job completing your study session! Now it's time to put your knowledge to the test. Challenge yourself, see how much you've learned, and identify areas for improvement. Don’t worry, this is all part of the journey to mastery. Ready for the next step? Take a quiz to solidify what you've just studied.