Answer to Question #20935 in C++ for apoorva

Question #20935
write a c++ program to get the value of 2 D array from the user having 3 rows and 3 columns and display its row and column sum
1
Expert's answer
2012-12-21T04:46:26-0500
#include <iostream>

using namespace std;

int main()
{


int a[3][3],i,j;
int s=0;
for (i=0;i<3;i++) {

for (j=1;j<3;j++) {
cin>>a[i][j];

s=a[i][j]+s;
}}

cout<<"sum= "<<s;


return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS