download Mastguru Android App

C++ Programming Questions Answers - Set 2 Online Quiz Test

  • 1. What is data hiding ?

    1. It is related with hiding internal object details
    2. It is related with showing internal object details
    3. It is related with datatypes
    4. None of above
  • 2. What is class in c++ ?

    1. When you define a class, you define a blueprint for a data type.
    2. When you define a class, you make get more funtionality.
    3. When you define a class, you define the logic.
    4. When you define a class, you make debugging.
  • 3. What is object in C++ ?

    1. Object is part of syntax of a class.
    2. Object is datatype of a class.
    3. Object is an instance of a class.
    4. Object is function of a class.
  • 4. What is purpose of abstract class ?

    1. to provide help with database connectivity.
    2. to provide data input to other classes.
    3. to provide security to other classes.
    4. to provide an appropriate base class from which other classes can inherit.
  • 5. Classes that can be used to instantiate objects are called concrete classes.

    1. True
    2. False
  • 6. What is default visibility mode for members of classes in C++ ?

    1. Private
    2. Public
    3. Protected
    4. Depends
  • 7. Which is more memory efficient ?

    1. structure
    2. union
    3. both use same memory
    4. depends on a programmer
  • 8. Which among following is not a valid visibility mode in c++ program ?

    1. Private
    2. Public
    3. Protected
    4. Limited
  • 9. Even if we define a function in a class, then also we need to declare it first.

    1. True
    2. False
  • 10. How we can define member function outside the class ?

    1. Using union
    2. Using structure
    3. Using pointers
    4. Using scope resolution
  • 11. Which among following is correct way of declaring object of a class ?

    1. Classname Objectname;
    2. Class Classname Objectname;
    3. Class Classname Object Objectname;
    4. Classname Object Objectname;
  • 12. How we can access data members using objects ?

    1. object@datamember
    2. object*datamember
    3. object->datamember
    4. object.datamember
  • 13. Can we define array of classes in c++ ?

    1. Yes
    2. No
  • 14. What is true about Constructor ?

    1. Its name is plural of class name.
    2. Its name has * symbol before it.
    3. Its name is same as of class name.
    4. Its name has # symbol before it.
  • 15. What is actual syntax of destructor in c++ ?

    1. !Classname( )
    2. @Classname( )
    3. $Classname( )
    4. ~Classname( )
  • 16. We can do constructor overloading in C++ ?

    1. True
    2. False
  • 17. A variable is defined within a block in a body of a function. Which of the following are true ?

    1. It is visible from the point of definition to the end of the program.
    2. It is visible throughout the function.
    3. It is visible from the point of definition to the end of the block.
    4. It is visible throughout the block.
  • 18. The major goal of inheritance in C++ is ?

    1. To facilitate the reusability of code
    2. To help modular programming
    3. To facilitate the conversion of data types
    4. To extend the capabilities of a class
  • 19. Which of the following keywords are used to control access to a class member ?

    1. protected
    2. switch
    3. goto
    4. for
  • 20. Which of the following cannot be passed to a function ?

    1. Array
    2. Reference variable
    3. Object
    4. File
Submit Quiz
Post a comment