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

Discussion :: Objects and Classes

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

      #include
      class Bix
      {    
            public:    
             int x; 
     };
     int main() 
     {    
         Bix *p = new Bix();   
         
        (*p).x = 10;    
        cout" " x " " ;     
       
        p->x = 20;   
        cout" " x ;    
       
       return 0; 
    }
    

  2. A.

    10 10 20 20

    B.

    Garbage garbage 20 20

    C.

    10 10 Garbage garbage

    D.

    Garbage garbage Garbage garbage

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment