break문, continue문
자바 프로그래밍/코드 2020. 2. 11. 00:09

//break문 public class Exam_02 { public static void main(String[] args) { int i =0; /* outer : while(true) { // 이 코드가 있는 부분을 outer라고 레이블(이름)을 지은 것 for(i=1;i

For문
자바 프로그래밍/코드 2020. 2. 10. 23:53

public class Exam_01 { public static void main(String[] args) { int i; for(i=1;i

Continue, break 연습(1~10까지 숫자 중, 1,3,4,6,7,8만 출력하기)
자바 프로그래밍/코드 2020. 2. 10. 23:53

public class Control { public static void main(String[] args) { int i; for(i=1;i

while문 이용하여 1~100 중에서 홀수만 출력하기
자바 프로그래밍/코드 2020. 2. 10. 23:51

public class Control { public static void main(String[] args) { int i = 49; // 초기값 지정 while(i

while문 이용하여 "hello java" 1,000번 출력하기
자바 프로그래밍/코드 2020. 2. 10. 23:50

//hello java 1,000번 출력 public class Quiz_09 { public static void main(String[] args) { int i = 0; while(i

100~1까지 거꾸로 출력하는 while문
자바 프로그래밍/코드 2020. 2. 10. 23:50

//1~100까지 출력 //거꾸로 100에서 1까지 public class Quiz_08 { public static void main(String[] args) { int i=101; while(i>1) { i--; System.out.print(i + " "); if(i%10==1) { System.out.println(); } } } }