Tuesday, July 14, 2009

NEED URGENT HELP IN C programming?

PLS tell how to calculate days between dates using structure pointers in C

NEED URGENT HELP IN C programming?
/* difftime example */


#include %26lt;stdio.h%26gt;


#include %26lt;time.h%26gt;





int main ()


{


time_t start,end;


char szInput [256];


double dif;





time (%26amp;start);


printf ("Please, enter your name: ");


gets (szInput);


time (%26amp;end);


dif = difftime (end,start);


printf ("Hi %s.\n", szInput);


printf ("It took you %.2lf seconds to type your name.\n", dif );





return 0;


}
Reply:read in two dates.


from the earlier date, keep adding one day, until you reach the other date.


Look at how many days you had to add.


you got what you wanted ;)


No comments:

Post a Comment