Question: #include using namespace std; int main() { const int rows=4, cols=4; int array[rows][cols]={12,22,34,45,22,1,2,5,4,98,21,13,3,21,45,11}; int product=1, product2=1, Tproduct; for (int index=0; index { for (int index2=0;

#include using namespace std;

int main() { const int rows=4, cols=4; int array[rows][cols]={12,22,34,45,22,1,2,5,4,98,21,13,3,21,45,11}; int product=1, product2=1, Tproduct; for (int index=0; index { for (int index2=0; index2 { if (index == index2) { product*=array[index][index2]; } } } for (int index3=3; index3>=rows; index3--) { for (int index4=0; index4 { product2*=array[index3][index4]; } } Tproduct = product2*product; cout< }

I'm trying to get the product of the two diagonal elements (12 x 1 x 21 x 11 x 3 x 98 x 2 x 45) this is giving me a smaller number. This is what I have so far. Help! This is c++ btw.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!