Home / C++ Programming / Objects and Classes :: Discussion

Discussion :: Objects and Classes

  1. Which of the following statement is correct about the program given below?

    
      #include
       class GateBase
      {   
           int x, y;    
           public:    
           GateBase(int xx = 10, int yy = 10)   
           {       
                xx= xx;      
                y = yy;     
            }     
            void Show()   
            {    
               coutclass GateDerived : public GateBase 
        {
           private:   
              GateBase objBase;  
           public:   
           GateDerived(int xx, int yy) : GateBase(xx, yy), objBase(yy, yy)     
           {         
              objBase.Show();     
           }
        };
        int main()
        {    
            GateDerived objDev(10, 20);   
            return 0;  
        }
    

  2. A.

    The program will print the output 100.

    B.

    The program will print the output 200.

    C.

    The program will print the output 400.

    D.

    The program will print the output Garbage-value.

    E.

    The program will report compile time error.

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment