import java.io.*;
import java.util.*;
public class Swap{
public static void main(String[] args)throws IOException{
Scanner scan=new Scanner(System.in);
int a,b,c;
System.out.println("Enter the value of a: ");
a=scan.nextInt();
System.out.println("Enter the value of b: ");
b=scan.nextInt();
System.out.println("Value of a "+a);
System.out.println("Value of b "+b);
c=b;
System.out.println("After:-\nValue of a: "+c);
b=a;
System.out.println("Value of b: "+b);
}
}
import java.util.*;
public class Swap{
public static void main(String[] args)throws IOException{
Scanner scan=new Scanner(System.in);
int a,b,c;
System.out.println("Enter the value of a: ");
a=scan.nextInt();
System.out.println("Enter the value of b: ");
b=scan.nextInt();
System.out.println("Value of a "+a);
System.out.println("Value of b "+b);
c=b;
System.out.println("After:-\nValue of a: "+c);
b=a;
System.out.println("Value of b: "+b);
}
}
Comments