Answer to Question #20935 in C++ for apoorva
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
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment