For Loop

Run Settings
LanguageJava
Language Version
Run Command
public class Main { //Junita Laras Wati public static void main(String[] args) { // Menampilkan deret Fibonacci menggunakan for loop int a = 0, b = 1; System.out.println(a); System.out.println(b); for (int i = 3; i <= 100; i++) { int c = a + b; if (c > 100) { break; // Hentikan jika nilai Fibonacci melebihi 100 } System.out.println(c); a = b; b = c; } } }
Editor Settings
Theme
Key bindings
Full width
Lines