Online Test for C++

  1. Data members is also called?
    Attribute
    Method
    Class
    Object

  1. Which of the following operator(s) cannot be overloaded?
    . (Member Access or Dot operator)
    ?: (Ternary or Conditional Operator )
    :: (Scope Resolution Operator)
    All of the above


  1. Which of the following mode declaration is used in C++ to open a file for input?
    ios :: app
    in :: ios
    ios :: in
    ios :: file

  1. The mechanism that binds code and data together and keeps them secure from outside world is known as
    Abstraction
    Encapsulation
    Inheritance
    Polymorphism

  1. Important advantage of using new and delete operators in C++ is
    Allocation of memory
    Frees the memory previously allocated
    Allocation of memory and frees the memory previously allocated
    Initialization of memory easily

  1. Which of the following operators can not be overloaded in C+ +?
    *
    ==
    +=
    ::


  1. Which of the following cannot be passed to a function in C++?
    Constant
    Structure
    Array
    Header file

  1. _________ allows to create classes which are derived from other classes, so that they automatically include some of its "parent's" members, plus its own members.
    Overloading
    Inheritance
    Polymorphism
    Encapsulation

  1. In C++ every statement end with?
    Colon (:)
    Comma (,)
    Dot (.)
    None of the above

  1. Which of the following is not a member of class?
    Static function
    Friend function
    Const function
    Virtual function

Post Your Question
Social Sharing
Search