Final answer:
The correct expression to swap the units and tens digits of a positive integer n is: 10(n%10) + n/10.
Step-by-step explanation:
The correct expression to swap the units and tens digits of a positive integer n is: 10(n%10) + n/10.
Let's break down the expression step by step:
- n%10 is used to get the remainder when n is divided by 10. This gives us the units digit of n.
- 10(n%10) multiplies the units digit by 10 to make it the new tens digit.
- n/10 is used to get rid of the original tens digit. It performs integer division to remove the units digit.
- Finally, 10(n%10) + n/10 adds the new tens digit (10(n%10)) and the removed units digit (n/10) to form the new integer.