#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    15
    Rep Power
    0

    Code that reads a Leap Year?


    How do I write a program that reads a 4 digit year and then determines whether that year is a leap year??
  2. #2
  3. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    792
    I'll give you a hint...
    leap years happen every 4 years
    that means the year should be divisible by 4
    i.e. it has no remainder
  4. #3
  5. Cast down
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    321
    Rep Power
    12
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    15
    Rep Power
    0
    Thanks this really helps I am so glad I found this site!!!!
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    15
    Rep Power
    0
    Thank you!
  10. #6
  11. ASP.Net MVP
    Devshed Specialist (4000 - 4499 posts)

    Join Date
    Aug 2003
    Location
    WI
    Posts
    4,378
    Rep Power
    1510
    every 4 years, except every hunderd (so 1900 and 2100 are not leap years), except every four hundred (so 2000 and 2400 are leap years)
    Primary Forum: .Net Development
    Holy cow, I'm now an ASP.Net MVP!

    [Moving to ASP.Net] | [.Net Dos and Don't for VB6 Programmers]

    http://twitter.com/jcoehoorn
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    15
    Rep Power
    0
    Thanks!

IMN logo majestic logo threadwatch logo seochat tools logo