#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

What is abstraction and encapsulation?

662


What causes polymorphism?

673


What is an advantage of polymorphism?

703


What is the significance of classes in oop?

678


What is the purpose of enum?

658






Are polymorphisms mutations?

798


What are objects in oop?

702


Get me a number puzzle game-program

1783


What is the difference between procedural programming and oops?

648


What is a class in oop?

678


design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)

6245


What is data binding in oops?

698


String = "C++ is an object oriented programming language.An imp feature of oops is classes and objects".Write a pgm to count the repeated words from this scenario?

2040


How do you use inheritance in unity?

680


What is difference between multiple inheritance and multilevel inheritance?

716