Home / C++ Programming / Functions - C++ :: Discussion

Discussion :: Functions - C++

  1. What will be the output of the following program?

      #include 
       class Base 
       {     
           public:  
           int S, A, M;    
           Base(int x, int y)    
           {       
              S = y - y;       
              A = x + x;     
              M = x * x;     
           }    
           Base(int, int y = 'A', int z = 'B')     
           {        
              S = y;   
              A = y + 1 - 1;    
              M = z - 1;   
       }  
       void Display(void)    
       {      
           cout" " " " class Derived : public Base
     {  
        int x, y, z;    
        public:    
        Derived(int xx = 65, int yy = 66, int zz = 67): Base(x)    
        {        
            x = xx;          
            y = yy;       
            z = zz;   
        } 
        void Display(int n)  
        {      
             if(n)     
                Base::Display();   
             else       
                cout" " " " nt main()
      {    
          Derived objDev;   
          objDev.Display(-1);    
          return 0;
      }
    

  2. A.

    65 65 65

    B.

    65 66 67

    C.

    A A A

    D.

    A B C

    E.

    The program will report compile time error.

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment