Using Calendar - Java
Easy Accuracy: 27.41% Submissions: 440 Points: 2


Your task is to complete the function timeBeforeAfterNdays(n) which accepts n as an argument and accepts day, month, year. You have to display the day (Sunday , Monday etc) after adding n to given date. The output will be in number from 1 to 7.  1 is Sunday.

Input Format:
The first line of input contains T denoting thr number of testcases. T testcases follow. Each testcase contains single line of input: n, day, month, and year separated by spaces.

Output Format:
For each testcase, in a new line, print the required answer.

Your Task:
Since this is a function problem, you don't need to take any input. Just complete the function timeBeforeAfterNdays that takes n, day, month, and year as parameters.

1 <= T <= 100
1 <= day <= 31
1 <= month <= 12

3 15 08 1947
Day after n days: 2

to report an issue on this page.


We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?


All Submissions

My Submissions:

Login to access your submissions.