Interchange
SOURCE CODE
import java.io.*;
import java.util.*;
public class Interchange
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
System.out.print("Enter first number :");
int a=sc.nextInt();
System.out.print("Enter second number :");
int b=sc.nextInt();
System.out.println("The values before interchange are "+a+" \t "+b);
int c;
c=a;
a=b;
b=c;
System.out.println("The values after interchange are "+a+" \t "+b);
}
}
Click here to Download
OUTPUT
If you have any question then leave a comment below I will do my best to answer that question.
Comments
Post a Comment