반복문2 자바 반복문을 이용한 구구단 출력(while, do while, for) //2단 출력 System.out.printf("2 * %d = %d\n", 1, 2*1); System.out.printf("2 * %d = %d\n", 2, 2*2); System.out.printf("2 * %d = %d\n", 3, 2*3); 한줄한줄 칠 필요 없이 int i=1; System.out.println("2단"); while(i 2022. 10. 5. 자바 반복문 while, do while, for 기본 문법 Java - Loop Control 반복문의 3요소 (초기값, 조건문, 증감문) 초기값에 증감문을 더하여 조건문이 참인 횟수만큼 statements가 실행됩니다 반복문 세가지 while, do while, for를 차례로 살펴보자 while 문법Syntax while(Boolean_expression) { // Statements } A while loop statement in Java programming language repeatedly executes a target statement as long as a given condition is true. Boolean_expression이 '참'이면 Statements가 실행됩니다. 거짓일때까지 반복! 기본 예제 public class LoopTe.. 2022. 9. 30. 이전 1 다음