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

Discussion :: Functions - C++

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

      #include
      class Freshergate
      {   
          int x, y, z;   
          public:   
          void Apply(int xx = 12, int yy = 21, int zz = 9)       
          {     
              x = xx;   
              y = yy += 10;   
              z = x -= 2;    
         }   
         void Display(void) 
         {     
             cout" " void SetValue(int xx, int yy)  
         {       
            Apply(xx, 0, yy);   
         }
     };
     int main()
     {   
         Freshergate *pGate= new Freshergate;    
         (*pGate).SetValue(12, 20);  
          pGate->Display();   
          delete pGate;   
          return 0; 
     }
    

  2. A.

    10 10

    B.

    12 10

    C.

    12 21

    D.

    12 31

    E.

    The program will report compilation error.

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment