MCQ Sets

  • Mock Ups
    • Computer Operator
      • 73-01
      • 73-02
      • 73-03
      • 73-04
      • 73-05
      • 73-06
    • Assistant Computer Operator
  • Quiz
    • Computer Fundamentals
    • Operating Systems
    • MS Word
    • MS Excel
    • MS PowerPoint
    • MS Access
    • HTML
  • Sets
    • Computer Fundamentals
    • Operating System
    • Microsoft Word
    • MS Excel
    • MS PowerPoint
    • MS Access
    • HTML & Web Page Designing
    • C++
    • Data Structures & Algorithms
  • Read
    • Tips & Articles
    • Fundamentals
    • MS Word
    • DBMS
    • Operating Systems
    • HTML & Web Page Design
  • Videos
  • Ask
    • Ask MCQ Sets
    • Discussion Forum
  • Downloads
  • Old Question Papers

Solved C++ MCQs Set 05

Updated: June 5, 2017     Written/composed/compiled by:  Suresh Khanal

C++ MCQ Questions

C++ Multiple Choice Questions

81. What is the implicit pointer that is passed as the first argument for nonstatic member functions?
a. ‘self’ pointer
b. std::auto_ptr pointer
c. ‘Myself’ pointer
d. ‘this’ pointer

82. Which of the following operators can be overloaded?
a. . (dot or member access operator)
b. & (address-of operator)
c. sizeof operator
d. ?: (conditional operator)

83. Which of the following operator cannot be overloaded?
#NAME?
b. == (equality operator)
c. –> (row operator)
d. :: (cope resolution operator)
84. Which of the following operators below allow to define the member functions of a class outside the class?

 a. ::
 b. ?
 c. :?
 d. %

85. Which of the following is not a valid conditional inclusions in preprocessor directives
a. #ifdef
b. #ifundef
c. #endif
d. #elif

86. Which of the following is not a standard exception built in C++.
a. std::bad_creat
b. std::bad_alloc
c. std::bad_cast
d. std::bad_typeid

87. If a member needs to have unique value for all the objects of that same class, declare the member as
a. Global variable outside class
b. Local variable inside constructor
c. Static variable inside class
d. Dynamic variable inside class

88. Under which of the following circumstances, synchronization takes place?
a. When the file is closed
b. When the buffer is empty
c. Explicitly, with manipulators
d. both a and c

89. Which of the following functions below can be used Allocate space for array in memory?
a. calloc()
b. malloc()
c. Realloc()
d. both a and b

90. Which of the following is not a valid conditional inclusions in preprocessor directives
a. #ifdef
b. #ifundef
c. #endif
d. #elif

91. Value of a in a = (b = 5, b + 5); is
a. Junk value
b. Syntax error
c. 5
d. 10

92. Minimum number of temporary variable needed to swap the contents of 2 variables is:
a. 1
b. 2
c. 3
d. 0

94. There is nothing like a virtual constructor of a class.
a. False
b. True

95. C++ provides facility to specify that the compiler should match function calls with the correct definition at the run time. This process is called as
a. Static binding
b. Dynamic Binding

96. The output of this program is

int
 main () { cout << "Hello World!" return 0; }

a. Hello World
b. Syntax error
c. 0
d. Hello World!

97. The return value of the following code is

Class1& test(Class1 obj)
 {
 Class1 *ptr = new Class1();
 .........
 return ptr;
 }

a. object of Class1
b. reference to ptr
c. reference of Class1
d. object pointed by ptr

98. The output of

{
int a = 5;
int b = 10;
cout << (a>b?a:b);
}

a. 5
b. 10
c. Syntax error
d. None of above

99. The output of this program is

int a = 10;
 void main()
 {
 int a = 20;
 cout << a << ::a;
 }

a. Syntax error
b. 10 20
c. 20 10
d. 20 20

100. Observe following program and answer

class Example{
 public: int a,b,c;
 Example(){a=b=c=1;} //Constructor 1
 Example(int a){a = a; b = c = 1;} //Constructor 2
 Example(int a,int b){a = a; b = b; c = 1;} //Constructor 3
 Example(int a,int b,int c){ a = a; b = b; c = c;} //Constructor 4
 }

In the above example of constructor overloading, the following statement will call which constructor
Example obj = new Example (1,2,3);
a. Constructor 2
b. Constructor 4
c. Constrcutor 1
d. Type mismatch error

Correct Answers to C++ MCQ Questions

81 – d 82 – d 83 – b 84 – d 85 – a 86 – b 87 – a 88 – b 89 – d 90 – a
91 – b 92 – d 93 – d 94 – a 95 – b 96 – b 97 – b 98 – b 99 – c 100 – b

Please, let us know if you discover any error or mistake in these MCQ sets. Don’t hesitate to leave your comments.

Download MCQ Questions PDF File for C++

Please visit Downloads section to download the pdf file of these MCQs from C++.

Other C++ MCQ Questions

  • C++ MCQ Questions Set 1
  • C++ MCQ Questions Set 2
  • C++ MCQ Questions Set 3
  • C++ MCQ Questions Set 4

Filed Under: C++ Tagged With: C, c++, C++ Questions, multiple choice questions

← Solved C++ MCQs Set 04 Solved C++ MCQs Set 02 →

Comments

  1. shradda says

    November 1, 2016 at 12:27 pm

    Answer of question 84 is a not d.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

User manuals http://manymanuals.com

Published MCQs for:

  • Computer Fundamentals
  • Operating Systems (Basics)
  • Word Processing (MS Word)
  • Spread Sheet (MS Excel)
  • Presentation (MS PowerPoint)
  • DBMS (MS Access)
  • Webpage Designing (HTML)
  • C++ Programming Language
  • Data Structures & Algorithms

Reading Materials for:

Fundamentals of Computers
► Syllabus of Computer Fundamentals
► Introduction to Computer Fundamentals
► History of Computers
► Computer Generations
► Classification of Computers
► Computer System
► Computer Hardware Concept
► Computer Software Concept
► Computer Networking
► Number System

Recent Posts

  • Which of the following is not an operating system?
  • Computer Networks MCQ Questions and Answers with PDF Download
  • Online Quiz MS PowerPoint
  • Solved Question Paper of PSC for NARC 2074-2-18
  • Computer Basics – Solved Question Paper of MPA 2017 (Spring) – Purbanchal University (PU)

MCQ Sets

  • Home
  • About Us
  • Contact Us
  • Privacy Policy
  • User Testimonials
  • Help MCQ Sets Grow More!
  • RSS Feeds
  • Sitemap

Recent Comments

  • Suresh Khanal on Microsoft Excel MCQ Questions – The First 100 MCQs
  • Suresh Khanal on Online MCQ Quiz for Fundamentals of Computers
  • Puspamunjali on Online MCQ Quiz for Fundamentals of Computers
  • emma on MCQ Sets Downloads
  • Solved C++ MCQs Set 03 » MCQ Sets on Solved C++ MCQs Set 01