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

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.
Similar Threads
  1. Anwesa Roy
    Replies:
    0
    Views:
    658
    Anwesa Roy
    Aug 22, 2016
  2. Abhinn

    how to change font syle in bluej

    Abhinn, Aug 28, 2016, in forum: Introductions
    Replies:
    0
    Views:
    870
    Abhinn
    Aug 28, 2016
  3. Ankit Tayal
    Replies:
    0
    Views:
    980
    Ankit Tayal
    Oct 1, 2016
  4. ross
    Replies:
    0
    Views:
    279
  5. Amy21
    Replies:
    0
    Views:
    439
    Amy21
    Jan 20, 2017
  6. Rohini
    Replies:
    0
    Views:
    211
    Rohini
    Feb 23, 2017
  7. SUser
    Replies:
    1
    Views:
    222
    kyrericard
    Apr 24, 2017
  8. Kritika Bhardwaj
    Replies:
    0
    Views:
    141
    Kritika Bhardwaj
    Mar 21, 2017
Loading...