Computer Programming using C++ Objective Test – Set 02

Are you guys looking for computer science MCQ Questions with Answers PDF Free Download as per computer science new exam pattern? You came to the right page. This may assist you to understand and check your knowledge about the Subjects. Students also can take a free test of the Multiple Choice Questions of computer science. Each question has four options followed by the right answer. These computer science MCQ Questions are selected supported by the newest exam pattern.


Q1. Which of the following is not true about preprocessor directives?

(A) They begin with a hash symbol
(B) They are processed by a preprocessor
(C) They form an integral part of the code
(D) They have to end with a semi colon

Answer: (A) They begin with a hash symbol


Q2. Each pass through a loop is called a/an

(A) Enumeration
(B) Iteration
(C) Culmination
(D) Pass through

Answer: (C) Culmination


Q3. Which of the following is/are advantages of cellular partitioned structure?

(A) Simultaneous read operations can be overlapped
(B) Search time is reduced
(C) Both a & b
(D) None of the above

Answer: (A) Simultaneous read operations can be overlapped


Q4. A continue statement causes execution to skip to

(A) The return 0; statement
(B) The first statement after the loop
(C) The statement following the continue statement
(D) The next iteration of the loop

Answer: (C) The statement following the continue statement


Q5. Which of the following is true about const member functions?

(A) Const members can be invoked on both const as well as nonconst objects
(B) Const members can be invoked only on const objects and not on nonconst objects
(C) Non-const members can be invoked on const objects as well as nonconst objects
(D) None of the above

Answer: (B) Const members can be invoked only on const objects and not on nonconst objects


Q6. When is std::bad_alloc exception thrown?

(A) When new operator cannot allocate memory
(B) When alloc function fails
(C) When type requested for new operation is considered bad, thisexception is thrown
(D) When delete operator cannot delete the allocated (corrupted) object

Answer: (D) When delete operator cannot delete the allocated (corrupted) object


Q7. Which classes allow primitive types to be accessed as objects?

(A) Storage
(B) Virtual
(C) Friend
(D) Wrapper

Answer: (B) Virtual


Q8. Which of the following relationship is known as inheritance relationship?

(A) ‘has-a’ relationship
(B) ‘is-a’ relationship
(C) Association relationship
(D) None of the above

Answer: (A) ‘has-a’ relationship


Q9. *ptr++ is equivalent to:

(A) ptr++
(B) ptr (C) ++ptr
(D) None of the above

Answer: (C) ++*ptr


Q10. What’s wrong? for (int k = 2, k <=12, k++)

(A) The increment should always be ++k
(B) The variable must always be the letter i when using a for loop
(C) There should be a semicolon at the end of the statement
(D) The commas should be semicolons

Answer: (B) The variable must always be the letter i when using a for loop


Q11. If class A is friend of class B and if class B is friend of class C, which of the following is true?

(A) Class C is friend of class A
(B) Class A is friend of class C
(C) Class A and Class C do not have any friend relationship
(D) None of the above

Answer: (B) Class A is friend of class C


Q12. What is the difference between overloaded functions and overridden functions?

(A) Overloading is a dynamic or run-time binding and Overriding is static or compile-time binding
(B) Redefining a function in a friend class is called function overriding while redefining a function in a derived class is called an overloaded function
(C) Overloading is a static or compile-time binding and Overriding is dynamic or runtime binding
(D) Redefining a function in a friend class is called function overloading while redefining a function in a derived class is called as overridden function

Answer: (B) Redefining a function in a friend class is called function overriding while redefining a function in a derived class is called an overloaded function


Q13. Which of the following is a valid destructor of the class name “Country”

(A) int ~Country()
(B) void Country()
(C) int ~Country(Country obj)
(D) void ~Country()

Answer:(B) void Country()


Q14. A direct access file is:

(A) A file in which records are arranged in a way they are inserted in a file
(B) A file in which records are arranged in a particular order
(C) Files which are stored on a direct access storage medium
(D) None of the above

Answer: (C) Files which are stored on a direct access storage medium


Q15. The conditional compilation

(A) It is taken care of by the compiler
(B) It is setting the compiler option conditionally
(C) It is compiling a program based on a condition
(D) None of above

Answer: (D) None of above


C++ Programming MCQ – All Set

C++ Programming MCQ Practice Test – Set 01
Computer Programming using C++ Objective Test – Set 02
C++ Programming Online Practice Test – Set 03
Computer Based Test C++ Programming – Set 04
C++ Programming Free Online Test – Set 05

We hope the given computer science Engineering on C++ Programming MCQ Questions with Answers will definitely yield fruitful results. Hope you got enough ideas on the MCQs on C++ Programming. If you have any queries related to computer science Engineering on C++ Programming MCQs Multiple Choice Questions with Answers, drop your questions below and will get back to you in no time.

Leave a Comment