943,917 Members | Top Members by Rank

Ad:
  • C Discussion Thread
  • Unsolved
  • Views: 1248
  • C RSS
Aug 25th, 2007
0

can anyboby help me?

Expand Post »
can anybody help me to write the following program.
program that will return the day of the particular date and year?
i.e.,user gives date,month and year.we have to print the day of it.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ramavundela is offline Offline
7 posts
since Aug 2007
Aug 25th, 2007
0

Re: can anyboby help me?

>>can anybody help me to write the following program
Yes someone here will help you but you first have to post your code and ask questions about what you don't understand. We will not write the program for you.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Aug 25th, 2007
0

Re: can anyboby help me?

i don't know the logic of this program.will u plz tell the logic?
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ramavundela is offline Offline
7 posts
since Aug 2007
Aug 25th, 2007
0

Re: can anyboby help me?

First declare three integers -- day, month and year. Then call scanf() to get user keyboard input. Finally call printf() to display the day.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Aug 25th, 2007
1

Re: can anyboby help me?

Featured Poster
Reputation Points: 1536
Solved Threads: 431
Posting Expert
iamthwee is offline Offline
5,865 posts
since Aug 2005
Aug 25th, 2007
0

Re: can anyboby help me?

>>print the day of it. That's what happens when you try to paraphrase the assignment.
I misunderstood that -- I did not realize it meant the day of the week.
Last edited by Ancient Dragon; Aug 25th, 2007 at 7:27 pm.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Aug 26th, 2007
0

Re: can anyboby help me?

user will give only date,month,year.we have to find out the day of it.
for eg:if we gave 26-08-2007
it should print sunday.user will not give the day.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
ramavundela is offline Offline
7 posts
since Aug 2007
Aug 26th, 2007
1

Re: can anyboby help me?

I don't know, if iamthwee's link doesn't give you the answer then I guess there isn't one.
Reputation Points: 47
Solved Threads: 17
Posting Whiz in Training
Tight_Coder_Ex is offline Offline
215 posts
since Feb 2005
Aug 27th, 2007
0

Re: can anyboby help me?

Can you use the standard library for this exercise. If so, look into mktime and localtime.
Team Colleague
Reputation Points: 2780
Solved Threads: 312
long time no c
Dave Sinkula is offline Offline
4,790 posts
since Apr 2004
Aug 29th, 2007
0

Re: can anyboby help me?

In general, you have to assign a specific date to be your ultimate beginning date. Then you calculate the exact number of days from that day to the day entered by the user. Then you can calculate the day-of-the-week from that value using the modulus (%) operator.
Moderator
Reputation Points: 3278
Solved Threads: 894
Posting Sage
WaltP is offline Offline
7,738 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C Forum Timeline: Displaying Average
Next Thread in C Forum Timeline: Using Turbo debugger





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC