1 package com.twister; 2 import java.util.Scanner; 3 4 public class Swap{ 5 6 public static void swap(int a,int b){ 7 System.out.println("Numbers before change are " 8 + a + " and " + b); 9 a = a + b; 10 b = a - b; 11 a = a - b; 12 System.out.println("Numbers after change are " 13 + a + " and " + b); 14 } 15 16 public static void main(String args[]){ 17 swap(new Scanner(System.in).nextInt(), 18 new Scanner(System.in).nextInt()); 19 } 20 }