Given two positive integers A and B where GCDA B C write a
Given two positive integers A and B, where GCD(A, B) = C, write a function using only A, B, and C that equals the lowest common multiple (LCM) of A and B. What day of the week (Mon-Sun) will it be 123,456,789 days after Sunday, New Year\'s Day (JAN 1) 2017?
Solution
6)
We know the formula
LCM * GCD = Product of two numbers
Let LCM be x
x * C = A * B
x = AB/C
Hence the lcm of (A,B) will be equal to AB/C
7)
123456789 days will have 17636684 weeks and 1 day
Hence if the starting day is sunday then after that many weeks it will be again sunday and next day which is the day required will be a monday
Hence the correct answer is Monday
