fork download
  1. #include <iostream>
  2.  
  3. int main() {
  4. // Contoh perulangan do-while: mencetak angka 0 hingga 4
  5. int i = 0;
  6. do {
  7. std::cout << "Iterasi do-while ke-" << i << std::endl;
  8. i++;
  9. } while (i < 5);
  10. return 0;
  11. }
Success #stdin #stdout 0.01s 5324KB
stdin
Standard input is empty
stdout
Iterasi do-while ke-0
Iterasi do-while ke-1
Iterasi do-while ke-2
Iterasi do-while ke-3
Iterasi do-while ke-4