package pack_ForDrill; import java.text.DecimalFormat; import java.util.Scanner; public class ForEvenNumber { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("첫 번째 숫자 입력 : "); int startNum = scanner.nextInt(); System.out.print("첫 번째 숫자 입력 : "); int endNum = scanner.nextInt(); scanner.close(); System.out.println(startNum + "부터" + endNum + "사이의 짝수"); for (int i = startNum; i <=endNum; i++) { if (i%2==0) { System.out.print(i); if (i < endNum -1) { System.out.print(", "); } } } } }