fork download
  1. class Main {
  2. public static void main(String[] args) {
  3. // Perulangan for untuk mencetak angka 0 hingga 4
  4. for (int i = 0; i < 5; i++) {
  5. System.out.println("Nilai i adalah: " + i); // Mencetak nilai i saat ini
  6. }
  7. }
  8. }
Success #stdin #stdout 0.13s 53620KB
stdin
Standard input is empty
stdout
Nilai i adalah: 0
Nilai i adalah: 1
Nilai i adalah: 2
Nilai i adalah: 3
Nilai i adalah: 4