Find the number after successive division | Function to find the number ; Driver Code
function findNum ( div , rem , N ) { var num = rem [ N - 1 ] ; for ( var i = N - 2 ; i >= 0 ; i -- ) { num = num * div [ i ] + rem [ i ] ; } return num ; } var div = [ 8 , 3 ] ; var rem = [ 2 , 2 ] ; var N = div . length ; document . write ( findNum ( div , rem , N ) ) ;