how to algorithm of swap the contents of two variable using a third variable

1 answer

1. Declare three variables a, b, and c.
2. Assign values to a and b.
3. Print the initial values of a and b.
4. Assign the value of a to c.
5. Assign the value of b to a.
6. Assign the value of c to b.
7. Print the final values of a and b.
8. End.

Pseudo code:

1. Declare variables a, b, and c
2. Assign values to a and b
3. Print the initial values of a and b
4. Assign the value of a to c
5. Assign the value of b to a
6. Assign the value of c to b
7. Print the final values of a and b
8. End