#include <iostream>
using namespace std;
int main() {
int a = 2;
int c[5][5];
for (int x=0;x<5;x++) {
for (int y=0;y<5;y++) {
c[x][y] = x*y;
}
}
cout << c[a][c[1][4]];
}

Answer Posted / girish

The answer of this program is very easy.
every time the arry indices are multiplication is done.
Then a is 2 this is right and the logic is in second index value is in square brackets[].
It calculate the second index value and it gives 1*4=4.
And the final answer is
a=2 and c[1][4] =4
then
c[2]4] is 8
Thank you

Is This Answer Correct ?    9 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you achieve runtime polymorphism?

573


What is basic concept of oop?

702


What is multilevel inheritance in oop?

557


What is the difference between abstraction and polymorphism?

619


What is the difference between inheritance and polymorphism?

594






What is class in oop with example?

625


• What are the desirable attributes for memory managment?

1730


IS IT NECESSARY TO INITIALIZE VARIABLE? WHAT IF THE INSTANCE VARIABLE IS DECLARED final ? IS IT NECESSARY TO INITIALIZE THE final VARIABLE AT THE TIME OF THEIR DECLARATION?

1585


what is different between oops and c++

2004


What is abstraction in oops?

591


When not to use object oriented programming?

572


program for insertion ,deletion,sorting in double link list

2285


Which method cannot be overridden?

584


How to call a non virtual function in the derived class by using base class pointer

5281


What is oops and why we use oops?

573