Given n = 985 and d = 43, demonstrate the quotient remainder theorem

The quotient-remainder theorem states that for positive integers n and d

n div d = q, n mod d = r <--> n = dq + r and 0 ≤ r < d

From our long division calculator, q = 985 ÷ 43 = Floor(22.) = 22

From our modulus calculator, we see that r = 985 mod 43 = 39

n = dq + r

985 = (43)(22) + 39

985 = 946 + 39

985 = 985