목록산술연산자 (1)
wasup
java 산술연산자
산술연산자에서 어려운건 없고 처음 접하는 분들이 약간 물음표를 띄울 수 있는건 '%'나머지 구하기인데 public class Op1 { public static void main(String[] args) { // TODO Auto-generated method stub int a=20, b=10, c=0; c = a+b; System.out.println(c); c = a - b; System.out.println(c); c = a * b; System.out.println(c); c = a/b; System.out.println(c); c = a%b; System.out.println(c); c = 12%5; System.out.println(c); } } a%b = 0, 12%5 = 2로 각 0과 ..
IT/Java
2020. 10. 20. 10:05