Algorithm to swap two numbers using a third variable.

1. Start.

2. Read two numbers. (let, a and b)

3. Initialize c = a;
                      a=b;
                      b=c;

4. Print numbers.

5. End

No comments:

Post a Comment