6 A student is tracing the following algorithm. The function INT gives the integer part of any number, eg \(\operatorname { INT } ( 2.3 ) = 2\) and \(\operatorname { INT } ( 6.7 ) = 6\).
Line 10 Input \(A , B\)
Line \(20 \quad\) Let \(C = \operatorname { INT } ( A \div B )\)
Line 30 Let \(D = B \times C\)
Line \(40 \quad\) Let \(E = A - D\)
Line 50 If \(E = 0\) then go to Line 90
Line 60 Let \(A = B\)
Line \(70 \quad\) Let \(B = E\)
Line 80 Go to Line 20
Line 90 Print \(B\)
Line 100 Stop
- Trace the algorithm when the input values are:
- \(A = 36\) and \(B = 16\);
- \(A = 11\) and \(B = 7\).
- State the purpose of the algorithm.