Times required by Simple interest for the Principal to become Y times itself | Function to return the no . of years ; Driver code
function noOfYears ( t1 , n1 , t2 ) { var years = ( ( t2 - 1 ) * n1 / ( t1 - 1 ) ) ; return years ; } var T1 = 3 , N1 = 5 , T2 = 6 ; document . write ( noOfYears ( T1 , N1 , T2 ) ) ;