0
Given the declarations below, which nested loop sums all of the elements in the array below please?
int scores[3][3] = { {92, 87, 91}, {88, 72, 93}, {100, 94, 97} }; int sum = 0;
2 Respostas
+ 9
I think this might work:
for(int I=0;I<3;I++)
{
for(int j=0;j<3;j++)
{
cout<<"\n"<<scores[I][j];
sum+= scores[I][j];
}
}
cout<<"\n"<<sum;
+ 9
the solved programme will look something like this:
https://code.sololearn.com/cEuja37PseFl/?ref=app