id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav.gupta@mq.edu.au recursion > diffDates2
prev  |  next  |  chance

First, solve https://codingbat.com/prob/p256024 Define a recursive function that when passed two dates, returns the difference (in days) between the two. For example, there is a difference of 367 days between 13/04/2011 and 15/04/2012. You may not use any loops. You may create helper functions if needed.


diffDates2(30, 12, 2000, 2, 1, 2001) → 3
diffDates2(15, 7, 1729, 9, 4, 2023) → 107284
diffDates2(1, 1, 2000, 1, 1, 2001) → 366

...Save, Compile, Run (ctrl-enter)

int diffDates2(int day1, int month1, int year1, int day2, int month2, int year2) { }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 5 Post-solution available

Copyright Nick Parlante 2017 - privacy