Functions

Q1: Which of the following statement is correct about the program given below?
#include<iostream.h> 
class AptitudeArray
{
    int Matrix[3][3]; 
    public:
    AptitudeArray()
    {
        for(int i = 0; i<3; i++)
           for(int j = 0; j < 3; j++) 
              Matrix[j][i] = i + j; 
    }
    void Display(void)
    {
        for(int i = 0; i < 3; i++)
           for(int j = 0; j < 3; j++) 
              cout<< Matrix[j][i] << ' '; 
    } 
}; 
int main()
{
    AptitudeArray objAptitude;
    objAptitude.Display();
    return 0; 
}

A The program will display the output 4 3 2 3 2 1 2 1 0.

B The program will display the output 0 1 2 1 2 3 2 3 4.

C The program will display the output 9 garbage values.

D The program will report error on compilation.

ANS:A - The program will display the output 4 3 2 3 2 1 2 1 0.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.