Given two double variables, bestValue and secondBestValue, write some code that swaps their values. Declare any additional variables as necessary.
.
.
Click on the title for the solution
.
.
double x;
x=bestValue;
bestValue=secondBestValue;
secondBestValue=x;
x=bestValue;
.
Click on the title for the solution
.
.
This is the answer:
:
double x;
x=bestValue;
bestValue=secondBestValue;
secondBestValue=x;
x=bestValue;
Comments
Post a Comment