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

Discussion :: Functions - C++

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

      #include
      class Freshergate
      {    
           public:   
           int x, y;   
           Freshergate(int xx = 10, int yy = 20)    
          {          
               x = xx;       
               y = yy;   
         }   
           void Exchange(int *, int *); 
      }; 
      int main() 
      {    
         Freshergate objA(30, 40);   
         Freshergate objB(50);      
         objA.Exchange(&objA.x, &objB.y);      
         cout" "  
         return 0; 
     }
     void Fresherate::Exchange(int *x, int *y)
     {   
           int t;  
           t  = *x;    
           *x = *y;    
           *y = t ;  
    }  
    

  2. A.

    20 10

    B.

    30 20

    C.

    20 30

    D.

    30 40

    E.

    50 30

    View Answer

    Workspace

    Answer : Option C

    Explanation :

    No answer description available for this question.


Be The First To Comment