Smallest N digit number divisible by N | Function to find the smallest N - digit number divisible by N ; Find largest n digit number ; Find smallest n digit number ; If i is divisible by N , then print i and return ; ; Given Number ; Function Call
function smallestNumber ( N ) { let L = Math . pow ( 10 , N ) - 1 ; let S = Math . pow ( 10 , N - 1 ) ; for ( let i = S ; i <= L ; i ++ ) { if ( i % N == 0 ) { document . write ( i ) ; return ; } } } let N = 2 ; smallestNumber ( N ) ;