Source Code
class Swapvariable { public static void main(String s[]) { int x,y; x=Integer.parseInt(s[0]); y=Integer.parseInt(s[1]); System.out.println("\nBefore Swap:\n"+"a="+x+"\tb="+y); x=x+y; y=x-y; x=x-y; System.out.println("\nAfter Swap:\n"+"a="+x+"\tb="+y); } }
Output
0 comments:
Post a Comment