void add(int A[][N], int B[][N], int C[][N]){
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
C[i][j] = A[i][j] + B[i][j];
}
Matrix Addition
Cpp recipesThe add() function takes two arrays as its arguments. The first array, A, is of length N and the second array, B, is of length N. The function will sum the elements in A and B and store the result in C.
0 Comments
Add Comment
Log in to add a comment