I need to know how can i get quotient and residue from a division executing just one operation, using python or c++.
Advertisement
Answer
JavaScript
x
3
1
quotient, reminder = divmod(10, 3)
2
print(quotient, reminder) # 3 1
3
I need to know how can i get quotient and residue from a division executing just one operation, using python or c++.
quotient, reminder = divmod(10, 3)
print(quotient, reminder) # 3 1