This section contains more frequently asked Programming In C++ Multiple Choice Questions and Answers in the various University Level and Competitive Examinations.

PRACTICE IT NOW TO SHARPEN YOUR CONCEPT AND KNOWLEDGE

1. If an array is declared as int a[4] = {3, 0, 1, 2}, then values assigned to a[0] & a[4] will be ________

  • 3, 2
  • 0, 2
  • 3, 0
  • 0, 4

2. Mechanism of deriving a class from another derived class is known as____

  • Polymorphism
  • Single Inheritance
  • Multilevel Inheritance
  • Message Passing

3. RunTime Polymorphism is achieved by ______

  • friend function
  • virtual function
  • operator overloading
  • function overloading

4. A function call mechanism that passes arguments to a function by passing a copy of the values of the arguments is __________

  • call by name
  • call by value
  • call by reference
  • call by value result

5. In C++, dynamic memory allocation is accomplished with the operator ____

  • new
  • this
  • malloc( )
  • delete

6. If we create a file by ‘ifstream’, then the default mode of the file is _________

  • ios :: out
  • ios :: in
  • ios :: app
  • ios :: binary

7. A variable defined within a block is visible

  • from the point of definition onward in the program.
  • from the point of definition onward in the function.
  • from the point of definition onward in the block.
  • throughout the function.

8. The break statement causes an exit

  • from the innermost loop only.
  • only from the innermost switch.
  • from all loops & switches.
  • from the innermost loop or switch.

9. Which of the following cannot be legitimately passed to a function

  • A constant.
  • A variable.
  • A structure.
  • A header file.

10. A property which is not true for classes is that they

  • are removed from memory when not in use.
  • permit data to be hidden from other classes
  • bring together all aspects of an entity in one place.
  • Can closely model objects in the real world.
Share with :