To find the day of the week

Find out what day of the week was January 12, 1979?
This question is related to Accenture Interview

Questions by neepabiswas

Editorial / Best Answer

bharat bhushan  

  • Member Since Feb-2008 | Feb 13th, 2008


when we move down in yearwise a day decreases. but when a leap year comes 2 days gets decreased..for  e.g.
12 jan 2008 --- saturday
12 jan 2007 --- friday
12 jan 2006 --- thursday
12 jan 2005 --- wednesday
12 jan 2004 --- monday..
so in 4 years five days gets reduced... so in this manner we can find out in which year wat day was on 12 jan..
ANSWER ----- it was friday on 12 jan 1979......

Showing Answers 1 - 10 of 10 Answers

when we move down in yearwise a day decreases. but when a leap year comes 2 days gets decreased..for  e.g.
12 jan 2008 --- saturday
12 jan 2007 --- friday
12 jan 2006 --- thursday
12 jan 2005 --- wednesday
12 jan 2004 --- monday..
so in 4 years five days gets reduced... so in this manner we can find out in which year wat day was on 12 jan..
ANSWER ----- it was friday on 12 jan 1979......

12th Jan 1979

1979 = 1900yrs + 78yrs + (period from 1st Jan to 12th Jan 1979)
 1900 yrs have 1 odd day(calculated as 1600yrs have 0 odd days, n 300yrs have 15 odd days i.e.15/7= 2 weeks+1 odd day.so,for 300yrs, it's 1 odd day.totally it's 0+1=1odd day for 1900yrs).
78yrs = 19leap yrs +59 ordinary yrs
          = 19 *2 +59 *1
          = 97days = 13weeks +6 odd days = 6 odd days
period from 1st Jan to 12th Jan 1979 =12 days = 1week + 5odd days = 5 odd days
 Therefore,
12th Jan 1979 = 1+6+5 = 12days =1 week +5 odd days =5 odd days
Therefore, 12th Jan 1979 was a Friday.
(Since,Sunday->0,Monday->1,...,Fri->5,sat->6)

anand3186

  • Jul 16th, 2009
 

Today is 16/07/2009 - thursday.
So, 12.07.2009 -> Sunday.
From jan - june, calculate the total no of odd days in each month
Jan = 3(31 days... 31%7=3)
Feb = 0
Mar = 3
Apr = 2
May = 3
Jun = 2
Total comes to 13. so, 13%7 is 6 or -1.
Since we are back calculating, take -1 as 1, so proceed one day forward from 12.07.2009 ie Sunady.
So, 12.01.2009 is Monday.
Calculate the total no of odd days in each year, from 1980 to 2009.
1 for normal yrs, and 2 for leap yrs.
There are 30 years from 1980 to 2009, out of which there are 8 leap yrs.
so, 1x22 + 2x8 = 38. now, 38%7 = +3.
Take -3 since we are back calculating.
go 3 days back from Monday(12.01.2009).
its FRIDAY !!!

  Was this answer useful?  Yes

tamilece

  • Feb 18th, 2010
 

Its formula to find the day of any date.


K+[(13M-1)/5)] + [D/4] + D + (C/4) - 2C

K- DATE
M-MONTH
D-LAST TWO DIGITS IN YEAR
C-FIRST TWO DIGITS IN YEAR

For months:
March is considered as first month.
April as second month.
.
.
.
January as 11 th month.(so decrement year by 1)
Febraury as 12th month.(so decrement year by 1)

Substitute all those details in formula
divide the answer by 7.
for remainder 0-sunday
                         1-monday
and soon.

tamilece

  • Feb 18th, 2010
 

Let me say how to use formula:

K+[(13M-1)/5)] + [D/4] + D + (C/4) - 2C
K- DATE
M-MONTH
D-LAST TWO DIGITS IN YEAR
C-FIRST TWO DIGITS IN YEAR

for months:
March is considered as first month.
April as second month.
.
.
.
January as 11th month (so decrement year by 1)
February as 12th month (so decrement year by 1)
substitute all those details in formula

divide the answer by 7.
(no need to consider the numbers after decimal point)
for remainder 0-sunday
1-monday
and soon.

Solution:

Given
k=12
m=11 (since month is January)
c=19
d=78 (since month is January, year is decremented by 1)
Substituting in formula:

12 +[{(13*11) -1}/5] + [78/4] + 78 + [19/4] - 2(19)
=12+ 28 + 19 +78 +4 - 38
= 103 (discard numbers after the decimal point)

Divide answer by 7
Remainder is 5
So solution is Friday

jan 12,1979-   lets determine the no. of odd days upto year 1978-(1600+300+78)

1600 is divisible by 400,therefore the no.of odd days is 0...
300 yrs has 1 odd day
78yrs consist of (19 leap + 59 ordinary years)=(19x2+59x1)=97 odd days where 2 and 1 are no.of odd days for leap and odd yrs respectively.(97%7=13 ,6 odd days)
therefore,jan 12,1979 falls on saturday!!!

  Was this answer useful?  Yes

jan 12,1979-   lets determine the no. of odd days upto year 1978-(1600+300+78)

1600 is divisible by 400,therefore the no.of odd days is 0...
300 yrs has 1 odd day
78yrs consist of (19 leap + 59 ordinary years)=(19x2+59x1)=96 odd days where 2 and 1 are no.of odd days for leap and odd yrs respectively.(96%7=13 ,6 odd days)
6+12+1=19(18/7 5 odd days)
therefore it is friday!!!

  Was this answer useful?  Yes

12-01-1979

1900        - 1 odd day

78             - 19 leap years          =  19*2  =38
                    59 ordinary years   =  59*1  = 59
                                                                 --------
                                                                     97 = 6 odd days  (97/7  remainder =6)

date  =12/7  = 5 odd days
  
total odd days  = 1 + 6 + 5  = 12 odd days

i.e  12/7 = 5 odd days

5 means Friday  (0- sun, 1- mon, 2- tue, 3- wed,.............)

ANS : Friday
                                                                

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions