While3. Integer positive numbers N and K are given. Using only the operations of addition and subtraction, find the quotient of division of integer N by K, and also the remainder of this division.

Solution in Python 3:

import random

N = random.randrange(1,99)
K = random.randrange(1,99)
print('N = ', N)
print('K = ', K)

r = N
q = 0
while r >= K:
r -= K
q += 1
print("Quotient: ", q)
print("Remainder: ", r)