3 messages · Page 1 of 1 (latest)
`void leapYear(int uYear, int* leap){
int ab = uYear - 1;
int at = 0;
int* an = leap;
for(; ab > 0; ab--) {
if (ab % 4 == 0){
at++;
} if (ab % 100 == 0 && ab % 400 != 0){
at--;
}
}
*an = at;
}
`
I've tested it for the current date and it seems correct.