public class ForExam{
public static void main(String[] args){
//for문을 이용해서 1부터 100까지 숫자 중 짝수만 출력해 보세요
int i=1;
for(i=1; i<=100; i++){
if(i%2==0){
System.out.println(i+"입니다.");
}
}
}
}
작성중인 코드―ForExam.java
1
2
3
4
5
6
7
8
9
10
11
12
publicclassForExam{publicstaticvoidmain(String[]args){//for문을 이용해서 1부터 100까지 숫자 중 짝수만 출력해 보세요inti=1;for(i=1;i<=100;i++){if(i%2==0){System.out.println(i+"입니다.");}}}}