Find the Nth digit from right in base B of the given number in Decimal base | Function to compute Nth digit from right in base B ; Skip N - 1 Digits in Base B ; Nth Digit from right in Base B ; Driver Code
def nthDigit ( a , n , b ) : NEW_LINE INDENT for i in range ( 1 , n ) : NEW_LINE INDENT a = a // b NEW_LINE DEDENT return a % b NEW_LINE DEDENT a = 100 NEW_LINE n = 3 NEW_LINE b = 4 NEW_LINE print ( nthDigit ( a , n , b ) ) NEW_LINE