Program to find the rate percentage from compound interest of consecutive years | Function to return the required rate percentage ; Driver code
function Rate ( N1 , N2 ) { var rate = ( N2 - N1 ) * 100 / N1 ; return parseInt ( rate ) ; } var N1 = 100 , N2 = 120 ; document . write ( Rate ( N1 , N2 ) + " " ) ;