Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database Administration The Essential Reference

Authors: Brian Laskey, David Kreines

1st Edition

1565925165, 978-1565925168

Students also viewed these Databases questions

Question

Sketch the Manchester encoding for the bit stream: 0001110101.

Answered: 1 week ago

Question

Why We Listen?

Answered: 1 week ago