954,505 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

can anyboby help me?

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.

ramavundela
Newbie Poster
7 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

>>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.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

i don't know the logic of this program.will u plz tell the logic?

ramavundela
Newbie Poster
7 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

First declare three integers -- day, month and year. Then call scanf() to get user keyboard input. Finally call printf() to display the day.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

>>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.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

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.

ramavundela
Newbie Poster
7 posts since Aug 2007
Reputation Points: 10
Solved Threads: 0
 

I don't know, if iamthwee's link doesn't give you the answer then I guess there isn't one.

Tight_Coder_Ex
Posting Whiz in Training
215 posts since Feb 2005
Reputation Points: 47
Solved Threads: 17
 

Can you use the standard library for this exercise. If so, look into mktime and localtime .

Dave Sinkula
long time no c
Team Colleague
5,058 posts since Apr 2004
Reputation Points: 2,780
Solved Threads: 314
 

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.

WaltP
Posting Sage w/ dash of thyme
Moderator
10,506 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You