Swap Two Values (No Extra Variable)

JavaScript Easy 5 views
Back to Questions
Next Shadowing Counter Medium N

Problem Description

You are given two values a and b. Swap them and print the swapped values. Use JavaScript style swap (no third variable).

Input Format

One line: a b (space separated).

Output Format

One line: swapped_a swapped_b.

Sample Test Case

Input:
5 9
Output:
9 5

Constraints

a and b are integers in range -1e9 to 1e9.

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Next