- Status
- Not open for further replies.

1 - 15 of 15 Posts

Another simple way is divide the year by 4. If it comes out without a remainder it is a leap year.

year is divisible by 4, but NOT by 100 OR year is divisible by 400.

DUH I don't see where I said anything about 100 or 400.Originally posted by Aftab:

year is divisible by 4, but NOT by 100 OR year is divisible by 400.

You have misunderstood what I said. I was pointing out the actual logic of calculating a leap year, I was not trying to say that you had said anything about dividing by 100 and 400. This is what I was trying to get across: A year is a leap year IF the year is divisible by 4 AND 100, OR is divisible by 400.DUH I don't see where I said anything about 100 or 400. Could you show where I did ?

Joined

·
1,074 Posts

why can't it be divisible by 100?

Joined

·
47,110 Posts

ALL THIS GAVE ME A HEAD ACHE

The reason it can't be divisible by 100 is because then we would have a leap year every 100 years (century years) as well as every 4 years. This would result in too many extra days being added, about 3 days every 400 years I think. Hope this makes sense.why can't it be divisible by 100?

Joined

·
1,074 Posts

i think so.

Joined

·
6,052 Posts

Joined

·
1,182 Posts

Same here,just took couple of paracetamolsOriginally posted by SIR****TMG:

ALL THIS GAVE ME A HEAD ACHE

How about this site:

http://www.codetoad.com/vb_leap_year.asp

Any year divisible by 400 will be divisible by 100 as well as 4. The operative function is If divisible by 4 cannot be divisible by 100 - so 2004 is a Leap Year.

2000 is a special case because it was divisble by all three...

( BTW - we do have leap years *every* 100 years

$year = 100;

while(1) {

system("cal 2 $year");

sleep 1;

$year+=100;

}

Prior to 1800 every century was a leap year...

Sorry/Bill

A year will be a leap year if it is divisible by 4 but not by 100. If a year is divisible by 4 and by 100, it is not a leap year unless it is also divisible by 400.

1 - 15 of 15 Posts

- Status
- Not open for further replies.

Join the discussion

Tech Support Guy

A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!

Full Forum Listing
Explore Our Forums

Recommended Communities

Join now to ask and comment!