What are the algorithm in stopwatch c language?

1 answer

Answer

1274702

2026-07-10 03:40

+ Follow

#include <stdio.h>

#include <time.h>

int main()

{

time_t start_time;

time_t stop_time;

int e;

clrscr();

printf( "Type the Enter key to START timing.\n");

while(getchar()!='\n');

start_time=time(NULL);

printf( "Type the Enter key to STOP timing.\n");

while(getchar()!='\n');

stop_time=time(NULL) ;

e=difftime( stop_time,start_time);

printf( "Elapsed time: %d seconds.\n" ,e) ;

getch();

}

ReportLike(0ShareFavorite

Copyright © 2026 eLLeNow.com All Rights Reserved.