즐거운프로그래밍

[자바] 노트패드++ if~else 문(다중 if 문)

수수께끼 고양이 2023. 10. 13. 14:26
728x90
반응형
public class ImportExam {
	public static void main(String args[]) {
			int a = 20;
			int b = 100;
			
			if(a==b) { 
				System.out.println(a+ "와 "+b+"는 같다.");
			}
			else if(a<b) {
				System.out.println(a+ "와 "+b+"는 보다 작다.");
			}
			else {
				System.out.println(a+ "와 "+b+"는 보다 크다.");
			}
	}
}

 

 

 

728x90
반응형