Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
sreesasu
#include <stdio.h> #include<stdlib.h> #include<time.h> void multiply(int siz,int frst[][siz], int scnd[][siz], int xt[][siz]); int main() { FILE* newfile; newfile=fopen("file.csv","w"); for(int size=1;size<=1000;size+=10){ int siz=size; double time; clock_t start; int frst[siz][siz]; int scnd[siz][siz]; int p,q; for(p=0;p<siz;p++) { for(q=0;q<siz;q++) { frst[p][q]=1; scnd[p][q]=1; } } int xt[siz][siz]; int i, j; start=clock(); for(i=0;i<5;i++){ multiply(size,frst, scnd, xt); } time= (double)(clock()-start)/(CLOCKS_PER_SEC*5); printf("\nsize:%d time:%.12f\n",size,time); fprintf(newfile,"%d,%d,%d,%.12f\n",siz,siz*siz,3*siz*siz,time); } fclose(newfile); return 0; } void multiply(int siz,int frst[][siz], int scnd[][siz], int xt[][siz]) { int i, j, k; for (i = 0; i < siz; i++) { for (j = 0; j < siz; j++) { xt[i][j] = 0; for (k = 0; k < siz; k++) xt[i][j] += frst[i][k]*scnd[k][j]; } } }
run
|
edit
|
history
|
help
0
Official Hello World
BSEARCH() WITH STRUCT
Hello world
String Manipulation
223780
squareifnal
Null deref
-Shello.c
RSA Algo
The endless numbers.