Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Can someone please help me with this C program?! Thanks! Write a complete progra

ID: 3696135 • Letter: C

Question

Can someone please help me with this C program?! Thanks!

Write a complete program, called multidimensional_array.c, that manipulates a 10 time 10 matrix. Given a 2-dimensional array M[10][10] as shown below, bullet Use a loop or nested loops to assign each element in M these values. Then print the values of M out, reserving 3 spaces for each array element. Overwrite the last element of each column (this is, the elements in the last row) by the sum of the first nine elements in the same column. Print out the values on the last row, which should be: -1 -1 -2 -3 -4 -5 -6 -7 1 -8

Explanation / Answer

#include <stdio.h>
#include <stdlib.h>
#define row 4
#define col 4
int main()
{
int m[row][col],i,j,k,l,sum=0;
printf("enter the array 10*10 elements:");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
scanf("%d",&m[i][j]);
}
}
printf("array elements are: ");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("%d ",m[i][j]);
}
printf(" ");
}
printf("Last elements of each coloum:");
for(i=0;i<row-1;i=0)
{ l=i;
for(j=0;i<row-1;i++)
{
sum += m[i][j];
}
printf("sum = %d ",sum);
j++;
i=l;
m[row][col]=sum;
sum=0;
if(i==9 && j==9)
exit(0);

}
printf("array elements are: ");
for(i=0;i<row;i++)
{
for(j=0;j<col;j++)
{
printf("%d ",m[i][j]);
}
printf(" ");
}
return 0;
}