1 #include <stdio.h> 2 #include <time.h> 3 #include<conio.h> 4 #include<iostream.h> 5 6 void main (void) 7 { 8 clrscr(); 9 int sum,a,b; 10 time_t time1,time2; 11 double dif_sec; 12 13 time (&time1); 14 cout << "Enter the value of a :"<<endl; 15 cin >> a; 16 cout << "Enter the value of b :"<<endl; 17 cin >> b; 18 sum = a + b; 19 20 time (&time2); 21 dif_sec = difftime (time2,time1); 22 cout << "\nThe sum is : " << sum<<endl; 23 cout << "\nIt took you " << dif_sec << " seconds to enter the numbers and calculate the sum"<<endl; 24 cout << "Press Any key to Continue....."; 25 getch(); 26 } 27