Tuesday, 6 October 2015

Class 8-Prog(Swap)

Pg :103  Q4




           

Swapping means exchanging . Here the values of 2 variables should be exchanged.

Imagine you have 2 jars with different liquids. You need to swap the liquids. What will you do? You will take one more jar to do this. Same technique we are applying here too.

We need the third variable to swap the given values.

No comments:

Post a Comment