Online Test for C++

  1. Which of the following storage classes have global visibility in C++?
    Register
    Static
    Auto
    Extern

  1. The constructor without parameter is called?
    Method Constructor
    Default Constructor
    Operator Constructor
    Function Constructor


  1. C++ actually supports the following two complete dynamic systems?
    One defined by C++ and the other not defined by C
    One defined by C and one specific to C++
    Both are specific to C++
    Both of them are improvements of C

  1. The Object is not declared for which class?
    Parent
    Base
    Abstract
    Derived

  1. Which diagram provides a formal graphic notation for modelling objects, classes and their relationships to one another?
    Object Diagram
    Analysis Diagram
    Instance Diagram
    Class Diagram

  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. Find Error/Output in follwing code:
  2.                                 
    #include <iostream>  
    
    using namespace std;  

    void square (int *x)  {
        *x = (*x)++ * (*x);  


    void square (int *x, int *y) {
        *x = (*x) * --(*y); 


    int main ( ) {
        int number = 30;          
        square(&number, &number);           
        cout << number;           
        return 0;  
    }
    910
    920
    870
    900

  1. When a method in a subclass has the same name and type signatures as a method in the superclass, then the method in the subclass _____ the method in the super class.
    Overloads
    Friendships
    Inherits
    Overrides

  1. Which of the following concepts means adding new concepts to a program as it runs?
    Data hiding
    Dynamic loading
    Dynamic typing
    Dynamic binding

  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

Post Your Question
Social Sharing
Search