fork download
  1. #include <stdio.h>
  2.  
  3. int main() {
  4. int i = 2; // mulai dari 2
  5.  
  6. while(i <= 10) { // kondisi berhenti
  7. printf("%d\n", i);
  8. i += 2; // tambah 2 setiap loop
  9. }
  10.  
  11. return 0;
  12. }
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
2
4
6
8
10