#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
Why interface is used?
What are oops methods?
What is destructor oops?
What is multilevel inheritance?
What is class encapsulation?
Why multiple inheritance is not possible?
When not to use object oriented programming?
How do you achieve polymorphism?
How do you define a class in oop?
Why do we need polymorphism in c#?
hi all..i want to know oops concepts clearly can any1 explain??
What are oops functions?
What do you mean by abstraction?
why reinterpret cast is considered dangerous?
What is the point of polymorphism?