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 Freshergate
      {    
           static int x;  
           public:    
           static void SetData(int xx)     
           {       
               this->x = xx;     
           }   
           static void Display()     
           {      
               cout
           }
       int Freshergate::x = 0;
       int main()
       {    
            Freshergate:SetData(22);  
            Freshergate::Display();    
            return 0;  
       }
    
    

  2. A.

    The program will print the output 0.

    B.

    The program will print the output 22.

    C.

    The program will print the output Garbage.

    D.

    The program will report compile time error.

    View Answer

    Workspace

    Answer : Option D

    Explanation :

    No answer description available for this question.


Be The First To Comment