MCQOPTIONS
Saved Bookmarks
This section includes 1331 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
| 1101. |
The protected access specifier is needed only when ................ is needed. |
| A. | inline function |
| B. | file |
| C. | friend function |
| D. | inheritance |
| Answer» E. | |
| 1102. |
What will be the output of the following code segment? main( ) { char s[10]; strcpy(s, “abc”); printf(“%d %d”, strlen(s), sizeof(s)); } |
| A. | 3 10 |
| B. | 3 3 |
| C. | 10 3 |
| D. | 10 10 |
| Answer» B. 3 3 | |
| 1103. |
A reference parameter is declared by proceeding with .................... |
| A. | * |
| B. | & |
| C. | && |
| D. | ~ |
| Answer» C. && | |
| 1104. |
Size of operator is ................ operator. |
| A. | compile time |
| B. | intrinsic |
| C. | extraction |
| D. | ternary |
| Answer» B. intrinsic | |
| 1105. |
The output of the following code segment will be char x = ‘B’; switch (x) { case ‘A’: printf(“a”); case ‘B’: printf(“b”); case ‘C’: printf(“c”); } |
| A. | B |
| B. | b |
| C. | BC |
| D. | bc |
| Answer» E. | |
| 1106. |
Inline is a ................ |
| A. | command |
| B. | statement |
| C. | request |
| D. | class |
| Answer» D. class | |
| 1107. |
C++ programs start their execution at ................ |
| A. | start() |
| B. | begin() |
| C. | main() |
| D. | output() |
| Answer» D. output() | |
| 1108. |
Which of the following for loop is not correct? |
| A. | for(;x<10;) |
| B. | or(; ; ;) |
| C. | for(; ;) |
| D. | for (x=0;x!=123;) |
| Answer» C. for(; ;) | |
| 1109. |
If the condition in a for loop is false then ................. |
| A. | code inside loop may not be executed. |
| B. | program terminates. |
| C. | code inside loop may be executed atleast once. |
| D. | shows error. |
| Answer» B. program terminates. | |
| 1110. |
The second expression (j – k) in the following expression will be evaluated (i + 5) && (j – k) |
| A. | if expression (i + 5) is true. |
| B. | if expression (i + 5) is false. |
| C. | irrespective of whether (i + 5) is true or false. |
| D. | will not be evaluated in any case. |
| Answer» B. if expression (i + 5) is false. | |
| 1111. |
The switch expression must be of type .................. or ................. |
| A. | char,float |
| B. | float,int |
| C. | int, char |
| D. | char, float |
| Answer» D. char, float | |
| 1112. |
‘C’ allows a three-way transfer of control with the help of |
| A. | unary operator |
| B. | relational operator |
| C. | ternary operator |
| D. | comparison operator |
| Answer» D. comparison operator | |
| 1113. |
scanf() can be used for reading |
| A. | double character |
| B. | single character |
| C. | multiple characters |
| D. | no character |
| Answer» D. no character | |
| 1114. |
A float variable can store any variable within the range of |
| A. | −1.7 ×1038 to 1.7 ×1038 |
| B. | − 3.4 ×1038 to 3.4 ×1038 |
| C. | − 7.2 ×1038 to 7.2 ×1038 |
| D. | −1.2 ×1038 to 1.2 ×1038 |
| Answer» C. − 7.2 ×1038 to 7.2 ×1038 | |
| 1115. |
The name of all functions end with a |
| A. | pair of parenthesis |
| B. | semicolon |
| C. | braces |
| D. | colon |
| Answer» B. semicolon | |
| 1116. |
The .............. storage class is used to declare reference variable. |
| A. | register |
| B. | static |
| C. | extern |
| D. | auto |
| Answer» D. auto | |
| 1117. |
The content of file will be lost if it is opened in |
| A. | w mode |
| B. | w+ mode |
| C. | a mode |
| D. | a+ mode |
| Answer» B. w+ mode | |
| 1118. |
The purpose of the code, answer = toupper(ans); is to ensure that ................ |
| A. | answer will be rounded to the next larger integer |
| B. | the first letter in answer will be a capital letter |
| C. | answer will contain all capital letters |
| D. | answer will contain no numeric values |
| Answer» D. answer will contain no numeric values | |
| 1119. |
In a two dimensional array called list with dimensions 4 X 9 the element 2,3 can be accessed by using the expression ................ |
| A. | list[3][2] |
| B. | list[2,3] |
| C. | list[2][3] |
| D. | list[3,2] |
| Answer» D. list[3,2] | |
| 1120. |
The declaration of a two dimensional array called list with dimensions 4 X 9 is represented as .................. |
| A. | int list [4] [9] |
| B. | int list [9][4] |
| C. | int list [4,9] |
| D. | int list[9,4] |
| Answer» B. int list [9][4] | |
| 1121. |
The variables in an array are called its ............... |
| A. | data |
| B. | index |
| C. | elements |
| D. | subscripts |
| Answer» D. subscripts | |
| 1122. |
Which header file is used for screen handling function:- |
| A. | IO.H |
| B. | STDLIB.H |
| C. | CONIO.H |
| D. | STDIO.H |
| Answer» E. | |
| 1123. |
A ............. local variable preserves its variable between function calls. |
| A. | extern |
| B. | static |
| C. | register |
| D. | auto |
| Answer» C. register | |
| 1124. |
The result of a relational or logical expression is of type .............. |
| A. | integer |
| B. | float |
| C. | Boolean |
| D. | character |
| Answer» D. character | |
| 1125. |
When local & global variable have same name to refer global variable ............... operator is used. |
| A. | ? : |
| B. | : |
| C. | : : |
| D. | << |
| Answer» D. << | |
| 1126. |
............. is not a type of scope in c++. |
| A. | global |
| B. | local |
| C. | file |
| D. | function |
| Answer» E. | |
| 1127. |
Which on of the following has the highest precedence? |
| A. | % |
| B. | ( ) |
| C. | || |
| D. | ?: |
| Answer» C. || | |
| 1128. |
Which one of the following is the conditional operator? |
| A. | ?: |
| B. | ?: = |
| C. | :? |
| D. | ?= |
| Answer» B. ?: = | |
| 1129. |
Which of the following is invalid assignment operator? |
| A. | -= |
| B. | &= |
| C. | ^= |
| D. | *= |
| Answer» D. *= | |
| 1130. |
............... operation inserts zero bits into low order bits of result. |
| A. | shift |
| B. | shifting left |
| C. | shifting right |
| D. | append |
| Answer» C. shifting right | |
| 1131. |
The ................ operation returns the remains of a divisions operation . |
| A. | . ! |
| B. | && |
| C. | % |
| D. | / |
| Answer» D. / | |
| 1132. |
>> is called as ............. operator. |
| A. | insertion |
| B. | extraction |
| C. | greater than |
| D. | lesser than |
| Answer» C. greater than | |
| 1133. |
A variable that receives an assigned value is called an ................ |
| A. | l value |
| B. | r value |
| C. | value |
| D. | assignment |
| Answer» B. r value | |
| 1134. |
What is the name of built-in function for finding square roots? |
| A. | square(x) |
| B. | sqr(x) |
| C. | sqrt(x) |
| D. | No built-in function |
| Answer» D. No built-in function | |
| 1135. |
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» E. | |
| 1136. |
Which of the following is not a file operation? |
| A. | Repositioning |
| B. | Truncating |
| C. | Readable |
| D. | Appending |
| Answer» D. Appending | |
| 1137. |
The maximum number of dimensions an array can have in C is |
| A. | 3 |
| B. | 4 |
| C. | 5 |
| D. | compiler dependent |
| Answer» E. | |
| 1138. |
The directive that can be used to test whether an expression evaluates to a nonzero value or not is |
| A. | #if |
| B. | #elif |
| C. | #endif |
| D. | #exit |
| Answer» B. #elif | |
| 1139. |
main() { long i = 30000; printf(“%d”, i); } the output is |
| A. | 3000 |
| B. | 30000 |
| C. | 0 |
| D. | -1 |
| Answer» C. 0 | |
| 1140. |
The *ptr++ is equivalent to ................ |
| A. | ptr++ |
| B. | *ptr |
| C. | ++*ptr |
| D. | none of the above |
| Answer» E. | |
| 1141. |
Which of the following is/are advantages of cellular partitioned structure? |
| A. | Simultaneous read operations can be overlapped |
| B. | Search time is reduced |
| C. | Both (A) & (B) |
| D. | Retrieval time is reduced |
| Answer» D. Retrieval time is reduced | |
| 1142. |
If storage class is missing in the array definition, by default it will be taken to be |
| A. | automatic |
| B. | external |
| C. | static |
| D. | either automatic or external depending on the place of occurrence. |
| Answer» B. external | |
| 1143. |
Which of the following is true about const member functions? |
| A. | const members can be invoked on both const as well as nonconst objects |
| B. | const members can be invoked only on const objects and not on nonconst objects |
| C. | nonconst members can be invoked on const objects as well as nonconst objects |
| D. | none of the above |
| Answer» B. const members can be invoked only on const objects and not on nonconst objects | |
| 1144. |
Consider the following declaration int a, *b = &a, **c = &b; The following program fragment a = 4; **c = 5; |
| A. | does not change the value of a |
| B. | assigns address of c to a |
| C. | assigns the value of b to a |
| D. | assigns 5 to a |
| Answer» E. | |
| 1145. |
How many copies of a class static member are shared between objects of the class? |
| A. | A copy of the static member is shared by all objects of a class |
| B. | A copy is created only when at least one object is created from that class |
| C. | A copy of the static member is created for each instantiation of the class |
| D. | No memory is allocated for static members of a class |
| Answer» B. A copy is created only when at least one object is created from that class | |
| 1146. |
How do we declare an interface class? |
| A. | By making all the methods pure virtual in a class |
| B. | By making all the methods abstract using the keyword abstract in a class |
| C. | By declaring the class as interface with the keyword interface |
| D. | By declaring the class as interface with the keyword interface |
| Answer» B. By making all the methods abstract using the keyword abstract in a class | |
| 1147. |
Choose the correct answer |
| A. | enum variable cannot be assigned new values |
| B. | enum variable can be compared |
| C. | enumeration feature increase the power of C |
| D. | None of the above |
| Answer» D. None of the above | |
| 1148. |
In a for loop, if the condition is missing, then, |
| A. | It is assumed to be present and taken to be false. |
| B. | It is assumed to be present and taken to be true. |
| C. | It results in a syntax error |
| D. | Execution will be terminated abruptly. |
| Answer» C. It results in a syntax error | |
| 1149. |
Which of the following is not a jump statement in C++? |
| A. | break |
| B. | goto |
| C. | exit |
| D. | switch |
| Answer» E. | |
| 1150. |
In C++, 14 % 4 = ................ |
| A. | 1 |
| B. | 2 |
| C. | 3 |
| D. | 4 |
| Answer» C. 3 | |