Computer Science (C++) MCQ

1 . In C++ every statement end with

  • colon(:)
  • Comma (,)
  • dot (.)
  • Semicolon (;)

Answer

Semicolon (;)

2. Base class is

  • normal class
  • derived class
  • child class
  • all of these

Answer

normal class

3. Which of the following is not a feature of C++.

  • Operator overloading
  • Inheritance
  • Namespace
  • Reflection

Answer

Reflection

4. Which of the following is not a member of the class?

  • Static function
  • Friend function
  • Virtual function
  • Const function

Answer

5. Which of the following is the correct class of the object cout?

  • iostream
  • istream
  • ostream
  • ifstream

Answer

ostream

6. Which of the following is not a type of inheritance?

  • Multiple
  • Multilevel
  • Distributive
  • Hierarchical

Answer

Distributive

7. In protected inheritance, a public data member of the base class will be treated in a derived class as.

  • public
  • private none of the above
  • protected
  • none of the above

Answer

public

8. main is a/an

  • keyword
  • object
  • function
  • none of the above

Answer

function

9. A set of arithmetic operators are.

  • + , – , * , / , %
  • < , > , >= , <=
  • &&, ||, !
  • none of the above

Answer

+ , – , * , / , %

10. A set of logical operators are.

  • + , – , * , / , %
  • < , > , >= , <=
  • &&, ||, !
  • none of the above

Answer

&&, ||, !

11. Which of the following concepts means determining at runtime what method to invoke.

  • Data hiding
  • Dynamic loading
  • Dynamic typing
  • Dynamic binding

Answer

Dynamic binding

12. is a way of combining data with functions into an object.

  • Object
  • Encapsulation
  • Inheritance
  • Constructor

Answer

13. eof is an acronym of

  • the ending of line
  • ending of files
  • end of file
  • None of the above

Answer

end of file

14. C++ language has been developed by

  • Dennis Ritchie
  • Ken Thompson
  • Martin Richard
  • Bjarne Stroustrup

Answer

Bjarne Stroustrup

15. Which operator has the lowest precedence?

  • Size
  • Urinary
  • Assignment
  • Comma

Answer

Assignment

16. The ternary operator operates on how many operands?

  • 1
  • 2
  • 3
  • 4

Answer

3

17. An instance of a class is called…….

  • private
  • object
  • public
  • None of the above

Answer

object

18. Which of the following library function below by default aborts the Program.

  • end ( )
  • terminate ( )
  • abort ( )
  • exit ( )

Answer

exit ( )

19. The individual elements in an array are called

  • encrypted
  • Decrypted
  • Subscripted
  • Identifier

Answer

Subscripted

20. The default access level assigned to members of the class is.

  • Private
  • Public
  • Protected
  • None of these

Answer

Private


Discover more from EduGrown School

Subscribe to get the latest posts sent to your email.