C++ Programming MCQs

12 practice MCQs on this page Page 3 of 3

Tap an option to check your answer — the correct answer and full explanation appear after you choose.

ProgrammingC++ Programming BPSCID: BPP-2781

In object-oriented programming, the same function behaving differently is called:

  1. AEncapsulation
  2. BAbstraction
  3. CPolymorphism ✓ Correct answer
  4. DInheritance
ProgrammingC++ Programming BPSCID: BPP-2783

In C++, the operator used to insert output is:

  1. A->
  2. B>>
  3. C==
  4. D<< ✓ Correct answer
ProgrammingC++ Programming BPSCID: BPP-3691

Which keyword is used to define a class in C++?

  1. Astruct
  2. Bobject
  3. Cclass ✓ Correct answer
  4. Ddefine
ProgrammingC++ Programming BPSCID: BPP-3692

In C++, the operator used to access a member through a pointer is?

  1. A.
  2. B&
  3. C::
  4. D-> ✓ Correct answer
ProgrammingC++ Programming BPSCID: BPP-3693

Which concept in C++ allows a function to have the same name with different parameters?

  1. AFunction overloading ✓ Correct answer
  2. BFunction overriding
  3. CInheritance
  4. DEncapsulation
ProgrammingC++ Programming BPSCID: BPP-3694

The destructor of a class in C++ is identified by which symbol before its name?

  1. A#
  2. B@
  3. C~ ✓ Correct answer
  4. D$
ProgrammingC++ Programming PPSCID: LTP-7708

The C++ programming language was created by:

  1. ABjarne Stroustrup ✓ Correct answer
  2. BJames Gosling
  3. CGuido van Rossum
  4. DDennis Ritchie
ProgrammingC++ Programming PPSCID: LTP-7709

In C++, which object is used to display output on the screen?

  1. Acin
  2. Bcout ✓ Correct answer
  3. Cprint
  4. Decho
ProgrammingC++ Programming PPSCID: LTP-7710

In C++, which object is used to take input from the user?

  1. Acout
  2. Bscanf
  3. Ccin ✓ Correct answer
  4. Dget
ProgrammingC++ Programming PPSCID: LTP-7711

C++ is best known as a language that supports which programming style?

  1. AOnly machine code
  2. BOnly web design
  3. COnly database queries
  4. DObject-oriented programming ✓ Correct answer
ProgrammingC++ Programming PPSCID: LTP-7712

In C++, which operator is used to allocate memory dynamically?

  1. Anew ✓ Correct answer
  2. Bmalloc
  3. Calloc
  4. Dcreate
ProgrammingC++ Programming PPSCID: LTP-7713

In C++, the symbol * when used with a pointer variable means:

  1. AMultiply two numbers only
  2. BDereference the pointer to get the value it points to ✓ Correct answer
  3. CStart a comment
  4. DEnd the program

Practice these MCQs interactively