We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 016dc6c commit 944b101Copy full SHA for 944b101
Lab3/a.out
4.01 KB
Lab3/naivemultiplication.c
@@ -1,7 +1,10 @@
1
#include<stdio.h>
2
+#include<time.h>
3
int main()
4
{
5
int r1,c1,r2,c2,i,j,k;
6
+clock_t s,e;
7
+float t;
8
printf("Enter the number of rows and columns of first matrix\n");
9
scanf("%d%d",&r1,&c1);
10
int A[r1][c1];
@@ -43,6 +46,7 @@ printf("%d\t",B[i][j]);
43
46
printf("\n");
44
47
}
45
48
printf("For the matrix multiplication process, we need number of columns of A matrix equal to the number of rows of B matrix\n");
49
+s=clock();
50
if(c1==r2)
51
52
int C[r1][c2];
@@ -72,5 +76,8 @@ else
72
76
73
77
printf("Matrix multiplication operation is not possible\n");
74
78
79
+e=clock();
80
+t=(float)(e-s)/CLOCKS_PER_SEC;
81
+printf("Time taken for processing is: %f\n",t);
75
82
return 0;
83
0 commit comments