home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Club Amiga de Montreal - CAM
/
CAM_CD_1.iso
/
files
/
463.lha
/
Date_routines
/
easter.c
< prev
next >
Wrap
Text File
|
1991-01-04
|
706b
|
27 lines
/*****
easter()
This function returns the date for Easter. If the return value is
greater than 31 (the number of days in March), the return value
minus 31 is the date in April. Otherwise, the return value is the
March date.
Argument list: int year the year desired (such as 1989)
Return value: int the date for Easter (see note
above)
*****/
int easter(int year)
{
int cen, leap, days, temp1, temp2;
cen = year % 19;
leap = year % 4;
days = year % 7;
temp1 = (19 * cen + 24) % 30;
temp2 = (2 * leap + 4 * days + 6 * temp1 + 5) % 7;
return (22 + temp1 + temp2);
}