LogoLearning For Everyone
Take Quiz
Contact Us
Related Topics
Related Topics
Selected Topic: All
6. What are the formal parameters in C++?
Choose the correct option:
  • a) Parameters with which functions are called

  • b) Parameters which are used in the definition of the function

  • c) Variables other than passed parameters in a function

  • d) Variables that are never used in the function

Formal parameters are those which are used in the definition of a function. They are the parameters that represent the actual parameters passed and they are the one which is used inside the function.

7. Which function is used to read a single character from the console in C++?
Choose the correct option:
  • a) cin.get(ch)

  • b) getline(ch)

  • c) read(ch)

  • d) scanf(ch)

C++ provides cin.get() function to read a single character from console whereas others are used to read either a single or multiple characters.

8. C++ is ______________
Choose the correct option:
  • a) procedural programming language

  • b) object oriented programming language

  • c) functional programming language

  • d) both procedural and object oriented programming language

C++ supports both procedural(step by step instruction) and object oriented programming(using concept of classes and objects).

3. Which of the following is correct?
Choose the correct option:
  • a) Base class pointer object cannot point to a derived class object

  • b) Derived class pointer object cannot point to a base class object

  • c) A derived class cannot have pointer objects

  • d) A base class cannot have pointer objects

C++ does not allow a derived class pointer to point a base class pointer whereas Base class can point to a derived class object. Both base class and derived class can have pointer objects.

2. Which of the following cannot be used with the virtual keyword?
Choose the correct option:
  • a) Class

  • b) Member functions

  • c) Constructors

  • d) Destructors

Virtual keyword cannot be used with constructors as constructors are defined to initialized an object of particular class hence no other class needs constructor of other class.

Items per page: