download Mastguru Android App

C++ Programming Questions Answers - Chapter 1 Online Quiz Test

  • 1. All members of class have which access to its members

    1. private
    2. public
    3. protected
    4. depends
  • 2. Which operator is used to define a member of a class from outside the class definition

    1. ->
    2. ::
    3. .
    4. >>
  • 3. Constructor is

    1. A class automatically called whenever a new object of this class is created
    2. A class automatically called whenever a new object of this class is destroyed
    3. A function automatically called whenever a new object of this class is created
    4. A function automatically called whenever a new object of this class is destroyed
  • 4. If no constructor is there, then compiler assumes the class to have a default constructor with no arguments

    1. True
    2. False
  • 5. How to define a destructor

    1. X~() {}
    2. X() {}~
    3. X() ~{}
    4. ~X() {}
  • 6. Can we overload constructors in C++

    1. Yes
    2. No
  • 7. Every class has atleast one construtor

    1. True
    2. False
  • 8. Declaring pointer more than one can cause

    1. Trap
    2. abort a program
    3. error
    4. none of above
  • 9. Meaning of deed copy is

    1. A deep copy creates a copy of the dynamically allocated objects too
    2. A deep copy just copies the values of the data as they are
    3. A deep copy creates a copy of the statically allocated objects too
    4. Both A and C
  • 10. Which is not a correct variable type

    1. float
    2. int
    3. double
    4. real
  • 11. Which is boolean operator for logical and

    1. &
    2. ||
    3. &|
    4. &&
  • 12. Difference between static and dynamic memory allocation is

    1. In static memory allocation memory to be allocated in preknown
    2. In dynamic memory allocation memory to be allocated in preknown
    3. There is no differnece
    4. Not exact difference is mentioned
  • 13. What is getline() in c++

    1. getline() extract the delimeter newline character from the input stream
    2. getline() does not extract the delimeter newline character from the input stream
    3. None of above
  • 14. expression x.y represents as

    1. member x of object y
    2. member y of object x
    3. member y of object pointed by x
    4. all of above
  • 15. Which of the following cannot be inherited from the base class

    1. Constructor
    2. Friend
    3. Both A and B cannot be inherited
    4. Both A and B can be inherited
  • 16. cout is declared in the _____ standard file within the std namespace

    1. outstream
    2. stdin
    3. iostream
    4. None of above
  • 17. How we mark the end of c++ statement

    1. ;
    2. :
    3. >>
    4. <<
  • 18. Dereference operator is also called as

    1. pointer
    2. Reference operator
    3. Offset operator
    4. Deoffset operator
  • 19. ios::ate is used for

    1. Set the initial position at the start of the file
    2. Set the last position at the end of the file
    3. Set the initial position at the end of the file
    4. Set the last position at the start of the file
  • 20. Which class has only one unique value for all the objects of class

    1. this
    2. friend
    3. static
    4. none of above
Submit Quiz
Post a comment