Let’s start writing code now. Sajan will help you break down the problem and then show you how to code it on the console. Let’s start with a very simple problem first. You will be given two integers x and y. You have to swap values stored in them. Have a look at the detailed problem statement in the coding quiz question at the end of this page.
Having understood the logic behind the problem, let's now take a look at how to code it using the coding console.
The approach explained by Sajan is quite simple and straight forward, can you think of a method that doesn't involve making a new variable or using a new container? Try your method below!