Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

if anyone sees the answer to this question please change it a bit This is my code for c language, could you answer as soon

if anyone sees the answer to this question please change it a bit

This is my code for c language, could you answer as soon as possible

#include int m, n, p, q, c, d, k, sum = 0; /* first, second and multiply array is used to store the first matrix, the second matrix and multiplied result respectively*/ int first[10][10], second[10][10], multiply[10][10];

void input() { printf("Enter number of rows and columns of first matrix "); scanf("%d%d", &m, &n); printf("Enter elements of first matrix "); for (c = 0; c < m; c++) for (d = 0; d < n; d++) scanf("%d", &first[c][d]); printf("Enter number of rows and columns of second matrix "); scanf("%d%d",&p, &q); printf("Enter elements of second matrix "); for (c = 0; c < n; c++) for (d = 0; d < q; d++) scanf("%d", &second[c][d]); }

void output(){

for (c = 0; c < m; c++) { for (d = 0; d < q; d++) printf("%d\t", multiply[c][d]); printf(" "); } }

int main() { input(); for (c = 0; c < m; c++) { for (d = 0; d < q; d++) { for (k = 0; k < p; k++) { sum = sum + first[c][k]*second[k][d]; } multiply[c][d] = sum; sum = 0; } } printf("Product of the matrices: "); output(); }

the task is to draw a structure chart that shows how the two functions developed are called in the main function. In the chart, you need to show what the arguments are and how they are passed in/out of the two functions. Also Modify the current program so the new code will perform matrix-vector product Ax.

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_2

Step: 3

blur-text-image_3

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

Practical Azure SQL Database For Modern Developers Building Applications In The Microsoft Cloud

Authors: Davide Mauri, Silvano Coriani, Anna Hoffma, Sanjay Mishra, Jovan Popovic

1st Edition

1484263693, 978-1484263693

More Books

Students also viewed these Databases questions