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)   {     
             x = xx;    
             y = yy;     
          }   
          void Show()  
         {        
          coutclass GateDerived
     {    
        private:   
          GateBase objBase;  
      public:   
      GateDerived(int xx, int yy) :    
      objBase(xx, yy)   
      {     
          objBase.Show();   
       } 
     };
     int main() 
     { 
        GateDerived objDev(10, 20);     r   
        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 Garbage-value.

    D.

    The program will report compile time error.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment