21. Swap the Seats

Acceptance 100% 1 accepted 1 submissions

Easy
BasicsVariables
No companies listed
In class, Rohan is sitting on bench a and Kabir on bench b. The teacher asks them to exchange benches.

Read two numbers a and b, swap their values, and print the new values in the format shown.

Input Format
A single line with two integers a and b.

Output Format
Print two lines:
a = <new value of a>
b = <new value of b>

Constraints
• -10^9 ≤ a, b ≤ 10^9

Example 1

Input
3 7
Output
a = 7
b = 3

Explanation After swapping, a gets 7 and b gets 3.

Example 2

Input
10 10
Output
a = 10
b = 10

Explanation Both are equal, so nothing visibly changes.

Example 3

Input
-5 8
Output
a = 8
b = -5

Explanation Negative numbers swap the same way.

Acceptance 100%
Accepted 1
Submissions 1
Auto-save
Saved Ln 1, Col 1
Submit a solution to see its status here.
Input
Expected Output
a = 7 b = 3
No results yet
Run your code to test it against the sample cases.
Problem List