
DAY 03 : 반복문, 중첩 반복문, 배열
2022. 10. 3. 00:41
국비/JAVA
- while문 while (조건식) { 조건식의 결과가 true인 동안 반복할 문장; ... } while문을 이용해 1 ~ 100까지의 짝수의 총합 구하기! public class WhileSum { public static void main(String[] args) { /* 1~100까지의 짝수의 총합*/ int sum = 0; int i = 0; while(i