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

Write a program in C that uses only one subprogram to do one of the following ca

ID: 3773132 • Letter: W

Question

Write a program in C that uses only one subprogram to do one of the following calculations over two two-dimensional run-time arrays: If the sizes of the two arrays are identical add them together. If the sizes of the two arrays are not identical then produce a product of the two arrays if the condition of the two matrices multiplication is valid. Otherwise, display a message saying that no arithmetic operation can be achieved over the two arrays. Also, the subprogram should return the sum of each array's elements. Repeat the program as long as the dimensions of the arrays are positive. Write the inputs and outputs in a "data" file and display on the computer screen.

Explanation / Answer

#include #include void main() { int a,i,k,j,c1,c2,r1,r2; int m1[10][10],m2[10][10],m3[10][10],rowSum[50] = {0}, colSum[50] = {0}; clrscr(); while(1) { printf(" 1. Addition of Matrix:- "); printf(" 2. Multiplication of Matrix:- "); printf(" 3. Exit "); printf(" Enter your choice:-"); scanf("%d",&a); switch(a) { case 1: printf(" how many row and coloum in Matrix one:-"); scanf("%d%d",&r1,&c1); printf(" How amny row and coloum in Matrix two:-"); scanf("%d%d",&r2,&c2); if((r1==r2)&&(c1==c2)) { printf(" Addition is possible:-"); printf(" Input Matrix one:-"); for(i=0;i
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote