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

Discussion :: Functions - C++

  1. Which of the following statement is correct about the program given below?

      #include
      class GateArray 
      {
         int array[3][3];  
         public:   
         GateArray(int arr[3][3] = NULL)   
         {         
            if(arr != NULL)      
            for(int i = 0; i 3; i++)              
               for(int j = 0; j 3; j++)                  
            array[i][j] = i+j; 
        }   
        void Display(void)  
        {      
           for(int i = 0; i 3; i++)              
              for(int j = 0; j 3; j++)                 
                 cout" ";           
       }
     };
     int main()
     {     
        GateArray objBA; 
        objBA.Display();  
        return 0; 
     }
    

  2. A.

    The program will report error on compilation.

    B.

    The program will display 9 garbage values.

    C.

    The program will display NULL 9 times.

    D.

    The program will display 0 1 2 1 2 3 2 3 4.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment