human
Find the Nth digit in the proper fraction of two numbers | Function to print the Nth digit in the fraction ( p / q ).
While N > 0 compute the Nth digit by dividing p and q and store the result into variable res and go to next digit.
Driver code"
Solution in Python:
assistant
#Here is code to find the Nth digit in the proper fraction of two numbers and the other steps required.
 def findNthDigit ( p , q , N ) :
	while ( N > 0 ) :
		N -= 1 ;
		p *= 10 ;
		res = p // q ;
		p %= q ;
	return res ;
if __name__ == " _ _ main _ _ " :
	p = 1 ; q = 2 ; N = 1 ;
	print ( findNthDigit ( p , q , N ) ) ;