2.3: Standard written algorithms
Problem 48 Use standard column arithmetic (i.e. long multiplication) to evaluate 9009 × 37. Why should you have foreseen the outcome?
Problem 49 In the long division shown here, all the digits are missing.
But the “shape” of the constituent numbers is clear.
Can you work out all possibilities for the two-digit divisor?
Problem 50 (For those readers who can write simple computer code.) In these problems you may choose your favourite programming language, and a device of your choice.
(a) Two non-negative integers m and n are to be entered in base 10, digit by digit, via a keyboard. Write computer code to implement the standard algorithms of column arithmetic in order to output to the screen (in the same format):
(i) m + n
(ii) m − n
(iii) m × n
(iv) (if n is a divisor of m ) m ÷ n
(v) (if n is not a divisor of m ) the integer part q of the quotient m ÷ n and the remainder r .
(b) Repeat the challenge of part (a), but this time try to write shorter code by using recursion (or other programming tricks).
(c) Repeat the challenge of parts (a) and (b), but this time with inputs and outputs in the binary numeral system (see Section 2.8 ).