Skip to main content

Checkpoint: swap via arithmetic

Challenge on lesson: Checkpoint: variables and types

CHALLENGE
Difficulty: beginner+25 XP

Implement String swapEnds(int a, int b): return both values swapped as "b a" (b, then a space, then a). You may reassign a and b โ€” but notice you will need a third variable to hold one value during the swap.

Back to lesson: Checkpoint: variables and types