Here is a number machine.
Verify that the output is 4 when the input is 81
Verify that the input is 45 when the output is 0
84 exam-style questions on OCR GCSE Maths Function Machines. Each one has a worked solution and a mark scheme showing where the marks go.