As a part of our regualr assignment of MCA, we had to generate a calendar using C. I made the program and using the help of the program cal tried ot check it. My program worked for approx 1500 years and then gave strange results. On thorough comparing with the cal program ( which comes with *nix and not my program) i found this... I tried
$cal 1 1752 and it showed Jan 1 is a wednesday $cal 1 1753 and it showed Jan 1 is a Monday.
On further investigation... i found it gives only half the calendar for september 1752. ie on $cal 9 1752 it started counting 1,2, 14, 15, 16 onwards. Why does it miss those 12 days. Or was there a historical event which comelled the world to miss 12 days?
According to the algo. If a year is leap the advancement in the number of days in successive dates of consecutive years shud be 2. But in this case the advancement (b/w years) is 5. or it went back 2 days. Is there a bug in cal or my program? I am using RH 7.1 with the kernels and programs which came with it, i have not upgraded any of the programs since.
thanx,
Goldwyn :o)