diff --git a/Program1 b/Program1 index d086496..ff675de 100644 --- a/Program1 +++ b/Program1 @@ -5,17 +5,17 @@ public class SwapNumbers { float first = 1.20f, second = 2.45f; System.out.println("--Before swap--"); - System.out.print("First number = " + first) + System.out.println("First number = " + first); System.out.println("Second number = " + second); // Value of first is assigned to temporary float temporary = first; // Value of second is assigned to first - first = second + first = second; // Value of temporary (which contains the initial value of first) is assigned to second - second += temporary; + second = temporary; System.out.println("--After swap--"); System.out.println("First number = " + first);