Consider the following flowchart:
Consider the following flowchart:
Solution 1
We start from the OUTPUT and work back to the INPUT.
Since the OUTPUT 32 is obtained from adding 16 to the previous number, the previous number is .
Since 16 is obtained by dividing the previous number by 2, then the previous number is or .
Since 32 is obtained by subtracting 8 from the INPUT, then the INPUT must have been .
Solution 2
Suppose that the INPUT is .
Subtracting 8 gives .
Dividing this result by 2 gives or .
Adding 16 to this result gives , which is the OUTPUT.
If the OUTPUT is 32, then or and so .
Therefore, the INPUT must have been 40.