Skip to content
Advertisement

Get quotient and residue from a division executing just one operation [closed]

I need to know how can i get quotient and residue from a division executing just one operation, using python or c++.

Advertisement

Answer

quotient, reminder = divmod(10, 3)
print(quotient, reminder)  # 3 1

https://docs.python.org/3/library/functions.html#divmod

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement