Click New Example to start working through an example. Click on the steps of the algorithm to see the values
of the variables in each step. First click on step 1. and then on the following steps in the order of execution.
New Example Restart Example
Algorithm. Division for negative numbers.
Input:
a negative integer a and a natural number b
Output:
Two integers q and r such that a=(q ⋅ b) + r and 0 ≤ r < b