Find Nth smallest number that is divisible by 100 exactly K times | Function to find the Nth smallest number ; If N is divisible by 100 then we multiply N + 1 otherwise , it will be divisible by 100 more than K times ; convert integer to string ; if N is not divisible by 100 ; convert integer to string ; add 2 * K 0 's at the end to be divisible  by 100 exactly K times ; Driver Code
function find_number ( N , K ) { var r ; if ( N % 100 == 0 ) { N += 1 ; r = N . toString ( ) ; } else { r = N . toString ( ) ; } for ( var i = 1 ; i <= K ; i ++ ) r += " " ; return r ; } var N = 1000 , K = 2 ; var ans = find_number ( N , K ) ; document . write ( ans ) ;