This is C Program to calculate the sum of the elements of each row & column. A matrix is made of rows and columns. The program will add all the rows and the columns of the matrix.
In this program a composed matrix will be used to add the rows and columns. The required variables are also declared that are contain the value. Array type variables also use for the loop statement. In this program nested for loop used to computing the sum for rows and columns of a composed matrix. First loop will be add to make matrix the other one will be the computing the rows addition and the next will be do the same for columns. In the last instance the result will be displayed on the screen.
Problem Statement :
This program will evaluate the sum of each row and column from composed matrix.
- Declaring array type variables.
- Using loop statement as required.
- Display the result on the screen.
Here is source code of the C program to compute the rows and columns of composed matrix. The C program is successfully compiled. The program output is also shown below.
printf("\nEnter Order of Matrix : ");
printf("\nEnter Elements : ");
Related Articles of C Programming