Q. 두 정수를 입력받아 a, b에 저장한 뒤 두 변수의 값을 교환하는 프로그램 구현
package org.joonzis.test;
public class Test_01 {
public static void main(String[] args) {
int a = 10;
int b = 5;
int c = a;
a = b;
b = c;
System.out.println("첫번째" + a + "두번째" + b );
}
}
출력결과
첫번째5두번째10