i don't know how to sum up two variables of clock_t

Joined
May 6, 2017
Messages
1
Reaction score
0
#include<stdio.h>
#include<time.h>
main()
{
clock_t start,end,d;
int i,l1 ;
char t2[10];
while(i<l1&&d<=15)
{
i=i+1;
start=clock();
printf("t2[%d]=\n",i);
scanf(" %c",&t2);
end=clock();
double extime=(double) (end-start)/CLOCKS_PER_SEC;
printf("\n\tExecution time for the bubble sort is %f seconds\n ",extime);
double d=(double)(d+extime)/(double)CLOCKS_PER_SEC;


if(d==15){

c1=c1+1;}
}


printf("\n\tExecution time for the bubble sort is %f seconds\n ",d);
printf("\n");
upload_2017-5-6_22-26-0.png


upload_2017-5-6_22-26-36.png
upload_2017-5-6_22-26-0.png
upload_2017-5-6_22-26-36.png
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,990
Messages
2,570,211
Members
46,796
Latest member
SteveBreed

Latest Threads

Top