JAVA January 16, 2022 Java program to write a simple way of Swapping Two Numbers Java program to write a simple way of Swapping Two Numbers //Swappping two numbers using third variable public class swapping_two_numbers { public static void main(String[] args) { int a=10,b=20,t; t=a; a=b; b=t; System.out.println("a"+a); System.out.println("b"+b); } } Output:
0 Comments
Post a Comment