From 07912520fb9fa9610c35003acd6988ce6b1b5b34 Mon Sep 17 00:00:00 2001 From: dulfazl <75079052+dXllllll@users.noreply.github.com> Date: Mon, 3 Mar 2025 11:10:42 +0530 Subject: [PATCH] Update Program1 --- Program1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);