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

1 answer

1. Set up three variables, let's call them A, B, and C.
2. Assign the value of A to C. (C=A)
3. Assign the value of B to A. (A=B)
4. Assign the value of C to B. (B=C)
5. Print out A and B to confirm that their values have been swapped.

Here is an example algorithm in Python:

```
A = 5
B = 10

# swapping the variables

C = A
A = B
B = C

# print out the swapped values

print("A is now: ", A)
print("B is now: ", B)
```

Output:

```
A is now: 10
B is now: 5
```