Total number of days taken to complete the task if after certain days one person leaves | Function to return the number of days required ; Driver code
function numberOfDays ( a , b , n ) { var Days = b * ( n + a ) / ( a + b ) ; return Days ; } var a = 10 , b = 20 , n = 5 ; document . write ( numberOfDays ( a , b , n ) ) ;