SWAP needs BYREF
Level 3: Parameters. The guide’s SWAP only works because both parameters are references. A copy would swap two locals and the caller would not change.
Write SWAP. It receives two integers by reference and exchanges them.
BYREF applies to the parameters after it as well, until BYVAL. So BYREF X : INTEGER, Y : INTEGER covers both.
Read two integers and output them after the swap, one per line.
Example: 1 then 2 →
2
1