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

Consider the following function CheckProds (A, B, C > >) where A is a 2D array o

ID: 3852840 • Letter: C

Question

Consider the following function CheckProds (A, B, C > >) where A is a 2D array of size (1: n. 1: n) and B and C are vectors of size (1: n), n a positive integral. The body of CheekSums implements the following computations: B (i) - A (i, 1)* A (1, 2)* A (1, 3)* *A (1, n) C (i) - A (1, 1) * A (2, 1) * A (3, 1) * * A (n, i) (a) Given the complete function CheckProds (A, B, C), including in particular the code of the function body and the method of passing the three parameters. (b) Determine for your function in addition to the space for the actual parameters).

Explanation / Answer

#include<stdio.h>
int n;
void checkprods(int A[][n],int B[],int C[])
{
int i,j;
for(i=0;i<n;i++)
{
B[i]=0;C[i]=0;
for(j=0;j<n;j++)
{
B[i]+=A[i][j];
C[i]+=A[j][i];
}
}
}
main()
{
n=2;
int A[n][n],B[n],C[n];
A[0][0]=1;
A[0][1]=2;
A[1][0]=3;
A[1][1]=4;
checkprods(A,B,C);
}

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