answersLogoWhite

0


Best Answer

#include <stdio.h>

int main ()

{

int year,days,d;

printf("year?"); scanf("%d",&year);

days = 365*year + (year-1)/4 - (year-1)/100 + (year-1)/400 ;

d=days%7;//to find which day of week

if(d==1)

printf("\n\n\tmonday");

else if(d==2)

printf("\n\n\ttuesday");

else if(d==3)

printf("\n\n\twednesday");

else if(d==4)

printf("\n\n\tthursday");

else if(d==5)

printf("\n\n\tfriday");

else if(d==6)

printf("\n\n\tsaturday");

else if(d==0)

printf("\n\n\tsunday");

return(0);

}

User Avatar

Wiki User

14y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

12y ago

#include

main()

{

int yr, lp_yrs, difference, total_days, day_of_week, weekday;

printf("Enter the year:");

scanf ("%d", &yr);

difference = (yr%100); /*difference between entered year and reference year*/

lp_yrs = (yr%100) / 4; /*no. of leap years between concerned year and reference year*/

total_days = (difference*365) + lp_yrs ;

day_of_week = total_days % 7;

if (day_of_week == 0)

{

printf("The day on Jan 1st of this year is Monday");

}

else if (day_of_week ==1)

{

printf("The day on Jan 1st of this year is Tuesday");

}

else if (day_of_week == 2)

{

printf("The day on Jan 1st of this year is Wednesday");

}

else if (day_of_week == 3)

{

printf("The day on Jan 1st of this year is Thursday");

}

else if (day_of_week ==4)

{

printf("The day on Jan 1st of this year is Friday");

}

else if (day_of_week ==5)

{

printf("The day on Jan 1st of this year is Saturday");

}

else if (day_of_week ==6)

{

printf("The day on Jan 1st of this year is Sunday");

}

}

This answer is:
User Avatar

User Avatar

Anonymous

Lvl 1
3y ago

vasu

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: According to the Gregorian calendar it was Monday on the date 01 01 1900 if any year is input through the keyboard write a c program to find your what is the day on 1st January of this year?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

When is winter semester?

There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.There is no standard. Each college and university has a start date particular to itself. However, the approximate start date for most institutions within the United States is around mid January. The college I teach at starts January 22, 2009.


What is the last date to apply for MPSC exam?

January 29,2012


Where was the blowtorch invented?

The blowtorch was invented in France, January 7, 1791


Can you get study visa under spp plan in Canada for January?

No January Intake is closed now so you can try for May or September Intake.There are 20 Colleges under Students Partners Program (SPP).


Who is the inventor tripod stand?

the inventor of the tripod stand was golbert mathews in 1850 january 8

Related questions

What are the months of the Sikh calendar?

1. Chet has 31 days and according to the Gregorian calendar it comes in the months of March-April 2. Vaisakhhas 31 days and according to the Gregorian calendar it comes in the months of April-June 3. Jeth has 31 days and according to the Gregorian calendar it comes in the months of June-July 4. Harh has 31 days and according to the Gregorian calendar it comes in the months of July-August 5. Sawan has 31 days and according to the Gregorian calendar it comes in the months of August-September 6. Bhadon has 30 days and according to the Gregorian calendar it comes in the months of September-October 7. Assu has 30 days and according to the Gregorian calendar it comes in the months of September-October 8. Katak has 30 days and according to the Gregorian it comes in the months of October-November 9. Maghar has 30 days and according to the Gregorian calendar it comes in the months of November-December 10. Poh has 30 days and according to the Gregorian calendar it comes in the months of December-January 11. Magh has 30 days and according to the Gregorian calendar it comes in the months of January-Febuary 12. Phagun has 30/31 days and according to the Gregorian calendar it comes in the months of Febuary-March Gregorian Calendar: Is the calendar that we use for our day to day lives; the calendar that we refer to.


When did Japan begin to use the Gregorian calendar?

Japan began to use the Gregorian calendar on January 1, 1873.


Which calendar is New Year's Day January 1?

The Gregorian calendar


What position is January on the calendar?

First on the gregorian calender.


When is feast of kings celebrated?

January 6 in the gregorian calendar, the 19th on a Julian calendar


When was New Year's Day on the gregorian calendar?

January 1


When was the gregorian calendar adopted?

1 st January 1752


When was New Year's Day on Gregorian calendar?

January 1


What was new years day on the gregorian calendar?

the 1st of January


When was new year's day on the Gregorian's calendar?

January 1


Is the calendar used today is Gregorian calendar?

There are various calendars used around the world now, like the Chinese calendar, but the main one, using the months from January to December is the Gregorian calendar.


When was the ninteenth centery?

The nineteeth century began January 1, 1801 and ended on December 31, 1900, according to the Gregorian Calendar.