Write a program to accept two dates in the format dd/mm/yyyy and print the number of days between the two dates if both the dates are valid.?

Home » Programming & Design » Write a program to accept two dates in the format dd/mm/yyyy and print the number of days between the two dates if both the dates are valid.?
Programming & Design No Comments

C

Best Answer:

EddieJ: You can calculate a date serial number with:

int dateSerial (int m, int d, int y) {
m = (m + 9) % 12;
y = y – m/10;
return 365*y + y/4 – y/100 + y/400 + (m*306 + 5)/10 + (d-1);
}

Other answer:

EddieJ:
Language.
no1home2day:
No, I don't feel like writing that program. I don't need it, and I don't want it, so why SHOULD I write that program?
roger:
you did not specify language
what have you tried so far
looks like homework…

LEAVE A COMMENT