write a java program to intialize two integer variables a and b with 5 and 6 ,respectively ,and interchange them .Thus after interchanging,a and b will be 6 and 5,respectively
Answers
Answered by
0
Answer:
public class interchange {
public static void main(String[] args) {
int a = 5, b = 6;
int temp;
temp = a;
a = b;
b = temp;
System.out.println("a: "+ a+" b: "+b);
}
}
Similar questions