과목: 프로그래밍 언어 활용
문제
70. 다음 JAVA 프로그램이 실행되었을 때의 결과는?
public class arrayl {
public static void main(String[] args) {
int cnt = 0;
do {
cnt++;
} while(cnt < 0);
if(cnt==1)
cnt++;
else
cnt=cnt+3;
System.out.printf("%d", cnt);
}
}
- ① 2
- ② 3
- ③ 4
- ④ 5
풀어보기
정답
- 1번