Java programming interchange two integer with using third variable
Answers
Answered by
1
import java.util.Scanner;
public class a
{
public static void main (String args())
{
Scanner sc=new Scanner (System.in);
system.out.println ("Enter the first number");
int a =sc.nextInt();
System.out.println("Enter the second number");
int b=sc.nextInt():
int c;
c=a;
a=b;
b=c;
System.out.println(" the first no after interchanging is "+a);
System.out.println ("the second no after interchanging is "+b);
}
}
Similar questions