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

Discussion in 'C Programming' started by ameni, May 6, 2017.

  1. ameni

    ameni

    Joined:
    May 6, 2017
    Messages:
    1
    Likes Received:
    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
     
    ameni, May 6, 2017
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.