Daa Lab 1
Daa Lab 1
int main() {
int n;
printf("Resultant Matrix:\n");
printMatrix(n, result);
return 0;
}
Multiplication: n3
In matrix multiplication, each element in the result matrix is obtained by
multiplying n elements from a row of the first matrix and a column of the
second matrix. For an n×n matrix, there are n^2 elements in the result matrix,
and each element requires n multiplications. Thus, the total number of
multiplications is n^3.
Total: 2 n3−n2
The total arithmetic operations required combine both multiplication (n^3)
and addition (n^3 - n^2), resulting in:
Total Operations=n3+(n3−n2)=2n3−n2
Step 4: Prepare a table for at least for 10 values of n.
Additions (A)
Multiplications (M)
Total Operations (T=A+M)
Output: