//Execution Time
Calculator in C
#include<stdio.h>
#include<conio.h>
#include<time.h>
void
main()
{
clock_t
begin, end;
double
time_spent;
int
x,y,sum;
begin =
clock();
clrscr();
printf("Enter
2 numbers\n");
scanf("%d%d",&x,&y);
sum=x+y;
printf("Sum=%d",sum);
end =
clock();
time_spent
= (double)(end - begin) / CLOCKS_PER_SEC;
printf("\n\nTime
Spent=%lf",time_spent);
getch();
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.