Simplest one:
c=a;
a=b;
b=c;
Note: The Value of the variable a & b must not exceed the maximum value that the variable can hold it.
This is the Most Safest Technique for swapping two integer variable in any language
c=a;
a=b;
b=c;
Note: The Value of the variable a & b must not exceed the maximum value that the variable can hold it.
This is the Most Safest Technique for swapping two integer variable in any language
No comments:
Post a Comment