Latihan Looping Java Menggunakan FOR
public class For {
public stattic void main(String[] args){
int b=0;
for(int i=1; i<6; i++){
int j=i*2;
System.out.print(j+”+”);
b=b+j;
if(j==10){
System.out.print(“=”);
System.out.print(a);
}
}
}
Hasil
2+4+6+8+10+=30
Tidak ada komentar:
Posting Komentar