Thread: leap year program

  1. #1
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693

    leap year program

    Assuming that January 1st of a certain leap year is a Monday, i have to compute the day of the week for a given date in that year. could someone help me out with my some pseudo code of how i should go about doing this? im not quite sure how to compute it.

  2. #2
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Yep... read up on the functions provided by the time library... #include the time.h header...

  3. #3
    Registered User camel-man's Avatar
    Join Date
    Jan 2011
    Location
    Under the moon
    Posts
    693
    do they have a function like that?

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Welllllll... you might try actually looking up the library documentation... If you don't have it locally with your compiler... Google is your friend.

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I think he's supposed to write this one by hand. This is a classic exercise, and there is actually a formula for calculating if a year is based on leap year. Behold, the power of the internet!


    Quzah.
    Hope is the first step on the road to disappointment.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by quzah View Post
    I think he's supposed to write this one by hand. This is a classic exercise, and there is actually a formula for calculating if a year is based on leap year. Behold, the power of the internet!


    Quzah.

    LOL... in that case.... nevermind!...

    It's not all that hard to do by hand just add up the days in each month, etc...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Leap year program using if statements
    By brian75 in forum C++ Programming
    Replies: 10
    Last Post: 12-06-2009, 02:57 PM
  2. why does this program say 1700 is a leap year?
    By newbcore in forum C Programming
    Replies: 7
    Last Post: 12-19-2008, 02:03 AM
  3. Program showing if a year its leap year or not.
    By Cyberman86 in forum C++ Programming
    Replies: 5
    Last Post: 09-12-2008, 08:00 AM
  4. Help with leap year program.
    By IxTanGxI in forum C Programming
    Replies: 8
    Last Post: 02-20-2006, 08:49 PM