Write an algorithm to swap three numbers
Answers
Answered by
1
So as you haven't mentioned the programming language in which you want the algorithm so i giving you a logical representation which you can implement in any language .
Consider a temporary variable temp
consider 3 variables a,b,c
copy the content of a in temp
copy the content of b in a
copy the content of c in b
copy the content of temp in c
That's it
Consider a temporary variable temp
consider 3 variables a,b,c
copy the content of a in temp
copy the content of b in a
copy the content of c in b
copy the content of temp in c
That's it
Similar questions
Physics,
7 months ago
English,
7 months ago
Math,
7 months ago
Social Sciences,
1 year ago
Social Sciences,
1 year ago
Science,
1 year ago
English,
1 year ago