Swapping (
Interchanging ) values of two variables
Algorithm for swapping values of two
variables:
Step1 : Start
Step2 :
Declare three variable a,b and temp
Step3 : Read
values of a and b from keyboard
Step4 :
Assign value of a into temp
Step5 :
Assign value of b into a
Step6 :
Assign value of temp into b
Step7 :
Print a and b.
Step8 : Stop
No comments:
Post a Comment