Using Calendar - Java
Submissions: 341   Accuracy:

22.64%

  Difficulty: Easy   Marks: 2
Associated Course(s):   Fork Java

 

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.

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

Examples:
1
3 15 08 1947
Output:
Day after n days: 2

** For More Input/Output Examples Use 'Expected Output' option **

Author: Soul_xhacker


If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.



Need help with your code? Please use ide.geeksforgeeks.org, generate link and share the link here.


to report an issue on this page.