-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
151738a
commit 343ecaa
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#include <iostream> | ||
using namespace std; | ||
|
||
int main() | ||
{ | ||
int i,j, m, n; | ||
cout<<"\nEnter number of rows and coloumns : "; | ||
cin>>m>>n; | ||
int arr[m][n]; | ||
cout<<"\nEnter elements of matrix : \n"; | ||
for (i = 0; i < m; i++) | ||
for (j = 0; j < n; j++) | ||
cin>>arr[i][j]; | ||
|
||
cout << "\nFinding Sum of each row:"; | ||
int sum=0; | ||
|
||
for (i = 0; i < m; ++i) {s | ||
for (j = 0; j < n; ++j) { | ||
sum = sum + arr[i][j]; | ||
} | ||
cout<< "\nSum of the row "<< i << " = " << sum << endl; | ||
sum = 0; | ||
} | ||
|
||
return 0; | ||
} |