1- void addMatrices(double result44] double a 44double b4141) 2 - void subMatric
ID: 3663698 • Letter: 1
Question
1- void addMatrices(double result44] double a 44double b4141) 2 - void subMatrices(double result 44] double af414 double b44) 3-void mulMatrices(double result 44] double al4l4] .double b4 4- void display Matrix(double af4l4]) 5 - void input Matrix(double a 4]/4) This function puts the result of adding the matrices represented by arrays a and b in the "resut array Same as above but for the subtraction operation. Implements Matrix multiplication Displays the contents of Matrix represented by "a on the sereen Prompts user to enter 16 elements of 4 by 4 array one by one. Entered numbers should be stored in "a" User should prompted which row and con will each entered number go to. 6- matrixlib.h should be populated with function prototypes of all functions above. d. main.cpp should include the header file matrixlib.h and use the functions defined in it to: 1 Ask user to enter the elements of two matrices called A and EB 2 Display A+B 3- Display A-B 4- Display A times BExplanation / Answer
IN C,
#include <stdio.h>
#include <conio.h>
void main()
{
int a[4][4],b[4][4],i,j;
clrscr();
printf("1st Matrix");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
scanf("%d",&a[i][j]);
printf(" ");
}
printf("2nd Matrix");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
scanf("%d",&b[i][j]);
printf(" ");
}
printf("Print 1st Matrix = ");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
printf("%d ",a[i][j]);
printf(" ");
}
printf("Print 2nd Matrix = ");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
printf("%d ",b[i][j]);
printf(" ");
}
printf(" addition of 1st and 2nd matrix = ");
for(i=0;i<=3;i++)
{
for(j=0;j<=3;j++)
printf("%d ",a[i][j]+b[i][j]);
printf(" ");
}
getch();
}
IN CPP,
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.