fork(6) download
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int num;
  6.  
  7. do {
  8. std::cout << "Insert a integer: ";
  9. std::cin >> num;
  10.  
  11. std::cout << "Your number was: " << num << std::endl;
  12. }
  13. while (num != -1);
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0.02s 2684KB
stdin
1
2
4
5
-1
stdout
Insert a integer: Your number was: 1
Insert a integer: Your number was: 2
Insert a integer: Your number was: 4
Insert a integer: Your number was: 5
Insert a integer: Your number was: -1