Question: PLEASE CONVERT THIS PROGRAM INTO FUNCTION I HAVE MENTIONED BELOW INSIDE THE CODE WHICH PART #include void main() { int i, j, k, marks[10][10], total[10],

PLEASE CONVERT THIS PROGRAM INTO FUNCTION I HAVE MENTIONED BELOW INSIDE THE CODE WHICH PART

#include

void main() { int i, j, k, marks[10][10], total[10], n; printf("Input elements in the matrix : "); for (i = 1; i < 6; i++) { for (j = 1; j < 5; j++) { printf("Enter marks of Student [%d] for Subject [%d] : ", i, j); scanf("%d", & marks[i][j]); } }

/*PLEASE CONVERT THE BELOW INTO FUNCTION WHERE ITS OUTPUT IS RETURNED TO MAIN FUNCTION */ printf("The matrix is : "); for (i = 1; i < 6; i++) { for (j = 1; j < 5; j++) printf("% 4d", marks[i][j]); printf(" "); }

/* This part of code find total of the marks */ for (i = 1; i < 6; i++) { total[i] = 0; for (j = 1; j < 5; j++) total[i] = total[i] + marks[i][j]; }

printf("The sum of marks are written in last column : "); for (i = 1; i < 6; i++) { for (j = 1; j < 5; j++) printf("% 4d", marks[i][j]); printf(" =% 8d", total[i]); printf(" "); } printf(" "); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!