MCQOPTIONS
Saved Bookmarks
This section includes 301 Mcqs, each offering curated multiple-choice questions to sharpen your Matlab knowledge and support exam preparation. Choose a topic below to get started.
| 151. |
A ‐‐‐‐‐‐‐‐ is a physical device that exists at run time. |
| A. | node |
| B. | package |
| C. | both a and b |
| D. | none of these |
| Answer» B. package | |
| 152. |
To increase the value of c by one which of the following statement is wrong? |
| A. | c++; |
| B. | c = c + 1; |
| C. | c + 1 => c; |
| D. | c += 1 |
| Answer» D. c += 1 | |
| 153. |
The operator ‘ |
| A. | Get from operator |
| B. | Put to operator |
| C. | Extraction operator |
| D. | None of these |
| Answer» C. Extraction operator | |
| 154. |
There is a unique function in C++ program by where all C++ programs start their execution |
| A. | start() |
| B. | begin() |
| C. | main() |
| D. | output() |
| Answer» D. output() | |
| 155. |
In an assignment statement a=b Which of the following statement is true? |
| A. | The variable a and the variable b are equal. |
| B. | The value of b is assigned to variable a but the later changes on variable b will not affect the value of variable a |
| C. | The value of b is assigned to variable a and the later changes on variable b will affect the value of variable a |
| D. | The value of variable a is assigned to variable b and the value of variable b is assigned to variable a. |
| Answer» C. The value of b is assigned to variable a and the later changes on variable b will affect the value of variable a | |
| 156. |
The operator we cannot use friend function |
| A. | ? |
| B. | Sizeof |
| C. | :: |
| D. | [] |
| Answer» E. | |
| 157. |
The binding of data and functions together into a single class‐type is referred to as ‐‐‐‐‐‐‐‐ |
| A. | Abstraction |
| B. | Encapsulation |
| C. | Inheritance |
| D. | Polymorphism |
| Answer» C. Inheritance | |
| 158. |
Calling a member function by using its name from another member function of the same class isknown as ‐‐‐‐‐‐ |
| A. | Grouping of member function |
| B. | Member function group |
| C. | Nesting of member function |
| D. | Nested group of member function |
| Answer» D. Nested group of member function | |
| 159. |
Which of the following is a UML relationship. |
| A. | dependency |
| B. | association |
| C. | generalization |
| D. | all of the above |
| Answer» E. | |
| 160. |
The memory management operator in c++ |
| A. | new &delete |
| B. | malloc |
| C. | calloc |
| D. | free |
| Answer» B. malloc | |
| 161. |
Blanks, tabs, newlines, form feeds and comments are collectively called ‐‐‐‐‐‐‐ |
| A. | Blank fields |
| B. | White space |
| C. | Null values |
| D. | Literals |
| Answer» C. Null values | |
| 162. |
Objects communicate with one another by using ‐‐‐‐‐‐‐‐‐‐. |
| A. | message passing |
| B. | operator overloading |
| C. | inheritance |
| D. | both a & b |
| Answer» B. operator overloading | |
| 163. |
Identify the valid integer from the following: |
| A. | 325.6 |
| B. | 255 356UL |
| C. | ‐3658 9586L |
| D. | +324454ul |
| Answer» E. | |
| 164. |
The operators can’t be overloaded |
| A. | Binary operators |
| B. | Unary operators |
| C. | Ternary operator |
| D. | None |
| Answer» D. None | |
| 165. |
In UML ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ is a collection of things tied together through relationships. |
| A. | things |
| B. | relationships |
| C. | diagrams |
| D. | none of these |
| Answer» D. none of these | |
| 166. |
Write the range of value of the data type ‘char’ |
| A. | 0 to 128 |
| B. | 0 to 255 |
| C. | ‐255 to 255 |
| D. | ‐128 to 127 |
| Answer» E. | |
| 167. |
Through ‐‐‐‐‐‐‐‐ we can eliminate redundant code and extend the use of existing class. |
| A. | inheritance |
| B. | operator overloading |
| C. | encapsulation |
| D. | both a & b |
| Answer» B. operator overloading | |
| 168. |
‐‐‐‐‐‐ are the smallest or the atomic elements of a language. |
| A. | Identifiers |
| B. | Literals |
| C. | Keywords |
| D. | Tokens |
| Answer» E. | |
| 169. |
A block comment can be written by |
| A. | Starting every line with double slashes (//) |
| B. | Starting with /* and ending with */ |
| C. | Starting with //* and ending with *// |
| D. | Starting with <!‐ and ending with ‐!> |
| Answer» C. Starting with //* and ending with *// | |
| 170. |
The main function having argument |
| A. | Default Argument |
| B. | Command line argument |
| C. | Const argument |
| D. | Constructor overloading |
| Answer» C. Const argument | |
| 171. |
Variables inside parenthesis of functions declarations have _____ level access. |
| A. | Local |
| B. | Global |
| C. | Module |
| D. | Universal |
| Answer» B. Global | |
| 172. |
The arrays of variable that are of the type class |
| A. | Array of object |
| B. | pointer |
| C. | Object |
| D. | Structure |
| Answer» B. pointer | |
| 173. |
We declare a function with ______ if it does not have any return type |
| A. | long |
| B. | double |
| C. | void |
| D. | int |
| Answer» D. int | |
| 174. |
Which one is the Object Oriented Programming language? |
| A. | Cobol |
| B. | C |
| C. | C++ |
| D. | both C & C++ |
| Answer» D. both C & C++ | |
| 175. |
Which of the following is the only technical difference between structures and classes inC++? |
| A. | Member function and data are by default protected in structures but private in classes. |
| B. | Member function and data are by default private in structures but public in classes. |
| C. | Member function and data are by default public in structures but private in classes. |
| D. | Member function and data are by default public in structures but protected in classes. |
| Answer» D. Member function and data are by default public in structures but protected in classes. | |
| 176. |
‐‐‐‐‐‐‐ can represent items of varying data types to an item. |
| A. | Class |
| B. | Array |
| C. | Structures |
| D. | Object |
| Answer» D. Object | |
| 177. |
How many times a constructor is called in the life‐time of an object? |
| A. | Only once |
| B. | Twice |
| C. | Thrice |
| D. | Depends on the way of creation of object |
| Answer» B. Twice | |
| 178. |
‐‐‐‐‐‐‐ are used for comparing two conditions or to write a compound condition. |
| A. | Relational operators |
| B. | Ternary operator |
| C. | Conditional operator |
| D. | Logical operator |
| Answer» E. | |
| 179. |
The function used to receive one character at a time |
| A. | get() |
| B. | put() |
| C. | getline() |
| D. | write() |
| Answer» B. put() | |
| 180. |
Which of the following is not a valid relational operator? |
| A. | 0 |
| B. | 0 |
| C. | >= |
| D. | >= |
| Answer» C. >= | |
| 181. |
The visibility of variables inside a structure is |
| A. | Private |
| B. | Public |
| C. | Protected |
| D. | None of these |
| Answer» C. Protected | |
| 182. |
The pointer refers to an object that has called the member function currently |
| A. | this |
| B. | address |
| C. | virtual function |
| D. | none |
| Answer» B. address | |
| 183. |
In object oriented Programming the program is divided into ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐. |
| A. | class |
| B. | object |
| C. | function |
| D. | none of these |
| Answer» C. function | |
| 184. |
The function contain in the ios class to set flags |
| A. | width() |
| B. | precision() |
| C. | fill() |
| D. | setf() |
| Answer» E. | |
| 185. |
The process by which objects of one class acquire the properties of objects of another class is called ‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ . |
| A. | abstraction |
| B. | inheritance |
| C. | encapsulation |
| D. | polymorphism |
| Answer» C. encapsulation | |
| 186. |
‐‐‐‐‐ is a function that is expanded in line when it is invoked. |
| A. | Library function |
| B. | User defined function |
| C. | Inline function |
| D. | None of these |
| Answer» D. None of these | |
| 187. |
‐‐‐‐‐‐‐‐‐‐‐‐‐‐‐ are conceptual things which exists only during the development process. |
| A. | Package |
| B. | node |
| C. | class |
| D. | none of the above |
| Answer» B. node | |
| 188. |
What is the difference between struct and class in C++? |
| A. | All members of a structure are public and structures don’t have constructors and destructors |
| B. | Members of a class are private by default and members of struct are public by default. When deriving a struct from a class/struct, default access-specifier for a base class/struct is public and when deriving a class, default access specifier is private. |
| C. | All members of a structure are public and structures don’t have virtual functions |
| D. | All of the above |
| Answer» C. All members of a structure are public and structures don’t have virtual functions | |
| 189. |
Output of the program?#includeusing namespace std;int fun(int x = 0, int y = 0, int z){ return (x + y + z); }int main(){ cout |
| A. | 10 |
| B. | 0 |
| C. | 20 |
| D. | Compiler Error |
| Answer» E. | |
| 190. |
Is it fine to call delete twice for a pointer?#includeusing namespace std;int main(){ int *ptr = new int; delete ptr; delete ptr; return 0;} |
| A. | Yes |
| B. | No |
| C. | none |
| D. | all |
| Answer» C. none | |
| 191. |
How can we restrict dynamic allocation of objects of a class using new? |
| A. | By overloading new operator |
| B. | By making an empty private new operator. |
| C. | By making an empty private new and new[] operators |
| D. | By overloading new operator and new[] operators |
| Answer» D. By overloading new operator and new[] operators | |
| 192. |
Default values for a function are specified when ____. |
| A. | Function is defined |
| B. | Function is declared |
| C. | Both a and b |
| D. | None of these |
| Answer» C. Both a and b | |
| 193. |
Choose the operator which cannot be overloaded. |
| A. | / |
| B. | ( ) |
| C. | :: |
| D. | % |
| Answer» D. % | |
| 194. |
Which of the followings is/are pointer-to-member declarator? |
| A. | ->* |
| B. | .* |
| C. | ::* |
| D. | both A and B |
| Answer» D. both A and B | |
| 195. |
Which of the following operator functions cannot be global? |
| A. | new |
| B. | delete |
| C. | Conversion Operator |
| D. | All of the above |
| Answer» D. All of the above | |
| 196. |
Which of the following operators are overloaded by default by the compiler in every user defined classes even if user has not written? 1) Comparison Operator (==) 2) Assignment Operator (=) |
| A. | Both 1 and 2 |
| B. | Only 1 |
| C. | Only 2 |
| D. | None of the two |
| Answer» D. None of the two | |
| 197. |
When a copy constructor may be called? |
| A. | When an object of the class is returned by value. |
| B. | When an object of the class is passed (to a function) by value as an argument. |
| C. | When an object is constructed based on another object of the same class |
| D. | All of the above |
| Answer» E. | |
| 198. |
Which of the followings is/are automatically added to every class, if we do not write ourown? |
| A. | Copy Constructor |
| B. | Assignment Operator |
| C. | A constructor without any parameter |
| D. | All of the above |
| Answer» E. | |
| 199. |
What operation can be performed by destructor? |
| A. | Abort the program |
| B. | Resource cleanup |
| C. | Exit from the current block |
| D. | None of the mentioned |
| Answer» C. Exit from the current block | |
| 200. |
class Test { int x;};int main() { Test t; cout |
| A. | 0 |
| B. | Garbage Value |
| C. | Compiler Error |
| D. | None |
| Answer» D. None | |