Question #23125

Create a two-demensional array of M X N elements. Write a program to find the row wise sum.

Expert's answer

#include<iostream>

using namespace std;
&
int main (){
int a[10][4],s=0;

for(int i=0; i<10; i++){
for (int j=0;j<4;j++){
cout<<"Enter a["<<i+1<<","<<j+1<<"] : ";
cin>>a[i][j];
}
& }
&
&
for(int i=0; i<10; i++){
for (int j=0;j<4;j++){
cout<< a[i][j]<<" ";
s+=a[i][j];

}
cout<<"sum:& "<<s<<endl;
s=0;
& }
&
&
system("PAUSE"); &
}
LATEST TUTORIALS
APPROVED BY CLIENTS