목록While (1)
today_is

오늘의 목표 >> for 와 while 을 이용하여 조건에 따른 반복문을 수행해보자. 반복문이란? : 특정 조건에 따라, 코드를 반복하여 수행하는 것. 반복문이 없다면 입.출력하고 싶은 만큼 코드를 붙여 넣어주어야 하기 때문에 한계가 있다. public class Ex01 { public static void main(String[] args) { //반복문 없이 출력 System.out.println("1"); System.out.println("1"); System.out.println("1"); System.out.println("1"); //무한반복 (횟수 지정 X) int num = 0; while(num < 50) { num ++; System.out.println("while : " + nu..
java
2023. 11. 20. 14:28