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.

Recommended Answers

All 9 Replies

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

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

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

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

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.

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

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

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.