MCQOPTIONS
Saved Bookmarks
This section includes 13 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures Mcqs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What value does function mystery return when called with a value of 4?int mystery ( int number ){if ( number |
| A. | 0 |
| B. | 1 |
| C. | 4 |
| D. | 24 |
| Answer» E. | |
| 2. |
An exception is caused by |
| A. | A hardware problem |
| B. | A problem in the operating system |
| C. | A syntax error |
| D. | A run-time error |
| Answer» E. | |
| 3. |
Consider the following statements char *ptr; ptr = hello ; cout |
| A. | First letter |
| B. | Entire string |
| C. | It is a syntax error |
| D. | Last letter |
| Answer» B. Entire string | |
| 4. |
How Late binding is implemented in C++? |
| A. | Using C++ tables |
| B. | Using Virtual tables |
| C. | Using Indexed virtual tables |
| D. | Using polymorphic tables |
| Answer» C. Using Indexed virtual tables | |
| 5. |
If the variable count exceeds 100, a single statement that prints Too many is |
| A. | If (count<100) cout << Too many , |
| B. | If (count>100) cout >> Too many , |
| C. | If (count>100) cout << Too many , |
| D. | None of these |
| Answer» D. None of these | |
| 6. |
If we create a file by ifstream , then the default mode of the file is _________ |
| A. | Ios :: out |
| B. | Ios :: in |
| C. | Ios :: app |
| D. | Ios :: binary |
| Answer» C. Ios :: app | |
| 7. |
Declaration of a pointer reserves memory space |
| A. | For the object |
| B. | For the pointer |
| C. | Both for the object and the pointer |
| D. | None of these |
| Answer» C. Both for the object and the pointer | |
| 8. |
Which of the following is correct about the statements given below? |. All operators can be overloaded in C++. ||. We can change the basic meaning of an operator in C++. |
| A. | Only I is true. |
| B. | Both I and II are false. |
| C. | Only II is true. |
| D. | Both I and II are true. |
| Answer» C. Only II is true. | |
| 9. |
Which one of the following is correct about the statements given below? |. All function calls are resolved at compile-time in Procedure Oriented Programming. ||. All function calls are resolved at compile-time in OOPS. |
| A. | Only II is correct. |
| B. | Both I and II are correct. |
| C. | Only I is correct. |
| D. | Both I and II are incorrect. |
| Answer» D. Both I and II are incorrect. | |
| 10. |
The operator |
| A. | Must be a member function |
| B. | Must be a non member function |
| C. | Can be both a & b above |
| D. | Cannot be overloaded |
| Answer» D. Cannot be overloaded | |
| 11. |
We can output text to an object of class ostream using the insertion operator |
| A. | The ostream class is a stream |
| B. | The insertion operator works with all classes |
| C. | We are actually outputting to cout |
| D. | The insertion operator is overloaded in ostream |
| Answer» E. | |
| 12. |
What is the output of the following code : char symbol[3]={ a , b , c };for (int index=0; index |
| A. | A b c |
| B. | Abc |
| Answer» D. | |
| 13. |
If x = y,5 = 2 then x y equals________.(where is a bitwise XOR operator) |
| A. | 00000111 |
| B. | 10000010 |
| C. | 10100000 |
| D. | 11001000 |
| Answer» B. 10000010 | |