Read an R×C matrix of integer values (R and C being predefined constants), print the same matrix with the sum of all elements of each row shown on the right and the sum of all values of each column displayed at the bottom.
int array[3][4];
int row,col,summcol,summrow[4]={0};
for(row=0;row<3;row++) {
summcol=0;
for(col=0;col<4;col++) {
scanf("%d",&array[row][col]);
summrow[col]+=array[row][col];
summcol+=array[row][col];
}
printf("The summ is%d \n",summcol);
}
for(col=0;col<4;col++) {
printf(" %d",summrow[col]);
}
This is the base of my code, but input and output should look like: 1 2 3 4 10 1 2 3 4 10 1 2 3 4 10 1 2 3 4 10 4 8 12 16 So i really dont know what i should to use for make this kind of interface be free to advises.Thx