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 ; ; Driver Code ; Given number ; Function call
def smallestNumber ( N ) : NEW_LINE INDENT L = pow ( 10 , N ) - 1 ; NEW_LINE S = pow ( 10 , N - 1 ) ; NEW_LINE for i in range ( S , L ) : NEW_LINE INDENT if ( i % N == 0 ) : NEW_LINE INDENT print ( i ) ; NEW_LINE return ; NEW_LINE DEDENT DEDENT DEDENT if __name__ == " _ _ main _ _ " : NEW_LINE INDENT N = 2 ; NEW_LINE smallestNumber ( N ) NEW_LINE DEDENT