public class Control {
public static void main(String[] args) {
int i;
for(i=1;i<=10;i++)
{
if(i==2 || i==5) {continue;}
System.out.println("i = " + i);
if(i==8) {break;}
}
}
}
'자바 프로그래밍 > 코드' 카테고리의 다른 글
break문, continue문 (0) | 2020.02.11 |
---|---|
For문 (0) | 2020.02.10 |
while문 이용하여 1~100 중에서 홀수만 출력하기 (0) | 2020.02.10 |
while문 이용하여 "hello java" 1,000번 출력하기 (0) | 2020.02.10 |
100~1까지 거꾸로 출력하는 while문 (0) | 2020.02.10 |
Comment