C PROGRAM EXAMPLE FOR SWAPPING 2 NUMBERS:
What is swapping?
Swaping is nothing but interchanging. It may be the value of 2 numbers or something to exchange between them. For example, consider below example.
- Before swapping, the values of A and B are as below.
A = 10
B = 20
- After swapping, the values of A and B will be as below.
A = 20
B = 10
OUTPUT :
Please enter the 1st number : 20
Please enter the 2nd number : 30
Before swapping:
A – 20
B – 30
After swapping:
A – 30
B – 20