How To Swap Two Numbers in C using Pointers

Well we can swap the values of 2 variables in C by using a temporary variable.

The idea is simple,

You can also ask the user to input the value sfor the variables, but for the shake of simplicity i commented it out.

Input : x = 10, y = 20
Output : x = 20, y = 10

That’s it, Thanks for reading.

o EOP o