Simple pascal questions/help

Soldato
Joined
5 Aug 2006
Posts
4,261
Making a program and a part of it needs to decide if the year (variable year oddly enough) is a leap year. But its not working, It compliles and runs fine but even if i enter a leap year it does not seem to match the conditions in the code below, probably something simple! now we only started pascal like last week - so dont like rewrite this as something complicated just help me fix it please :)

Code:
If (year Mod 400 = 0) and (year Mod 4 = 0) and (year mod 100 <> 0)

as i said very new to to this so excuse it
 
Well i mansacked that one up.

Code:
(year mod 4 = 0) and (not ((year mod 100 = 0) and (year mod 400 <> 0)))

working now. ignore me people :)
 
Back
Top Bottom