C# program to find the sum of each row of the matrix
All Answers
total answers (1)
Severity: 8192
Message: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated
Filename: libraries/Filtered_db.php
Line Number: 23
total answers (1)
Program:
The source code to find the sum of each row of the matrix is given below. The given program is compiled and executed successfully on Microsoft Visual Studio.
Output:
Explanation:
In the above program, we created a class MatrixDemo that contains a Main() method. The Main() method is the entry point for the program, Here we created a 2-D array to represent a matrix.
In the above code, we read the elements of the matrix and print the matrix on the console screen.
Here, we calculated the sum of each row of the matrix and then print the sum of each row on the matrix.