An algorithm to swap two numbers using a third variable


Write an algorithm to swap two numbers using a third variable:-


Step 1 : START 


Step 2 : Declare variables  a , b and temp .


Step 3 : Read the values of variable  a and b.


Step 4 : temp = a ;    a = b ;    b = temp ;


Step 5 : Display the values of  a and b .


Step 6 : STOP 








Comments