A function returns a copy
Level 3: Parameters. RETURN hands back a value. The caller’s variables are unchanged unless you also used BYREF — functions are how Paper 2 avoids that.
Write Max(A, B) so it returns the larger integer (either one if they are equal).
Read two integers and output Max of them.
Example: 3 then 5 → 5.
- Previous: BYREF sticks until BYVAL
- Next: Reference or copy?
- AS & A Level Path