day of week

This is a discussion on day of week within the C Programming forums, part of the General Programming Boards category; Can someone help me with how I should go about how the inputted date is stored? Also, what I need ...

  1. #16
    Registered User
    Join Date
    Mar 2005
    Posts
    60
    Can someone help me with how I should go about how the inputted date is stored? Also, what I need to do to compute the century and year in part (c) of this problem? I would greatly appreciate any additional help on this.

  2. #17
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    You're still missing a semicolon and stuff. Let's see your latest code.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #18
    Super Moderator Harbinger's Avatar
    Join Date
    Nov 2004
    Posts
    74
    Start with

    Code:
    scanf ("%d","%d","%d",&day,&month,&year);
    printf( "%d %d %d\n", day, month, year );

    Then go on to
    Code:
    scanf ("%d","%d","%d",&day,&month,&year);
    M = (26 * 10)-2) /10;
    printf( "%d %d %d %d\n", day, month, year, M );
    Add the rest of the rules for your calculation one variable at a time until your program is complete.

  4. #19
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Code:
    scanf ("%d","%d","%d",&day,&month,&year);
    Ahem. You're passing scanf() too many arguments. Perhaps you mean
    Code:
    scanf("%d/%d/%d", &day, &month, &year);
    This code
    Code:
    M = (26 * 10)-2) /10;
    is still completely wrong.

    That's why I want to see the latest code.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Help with day of the week program
    By Punkakitty in forum C++ Programming
    Replies: 10
    Last Post: 01-14-2009, 06:55 PM
  2. Force end
    By Redattack34 in forum C++ Programming
    Replies: 9
    Last Post: 09-07-2005, 12:16 AM
  3. The day of the week America was discovered
    By Gustaff in forum C Programming
    Replies: 3
    Last Post: 08-12-2005, 10:47 AM
  4. debug program
    By new_c in forum C Programming
    Replies: 3
    Last Post: 03-18-2002, 11:50 PM
  5. Simplified code
    By soonerfan in forum C Programming
    Replies: 2
    Last Post: 12-05-2001, 03:50 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21