fork(24) download
#include 

int main()
{
    int num;
    
    do {
        std::cout << "Insert a integer: ";
        std::cin >> num;
        
        std::cout << "Your number was: " << num << std::endl;
    }
    while (num != -1);
    
    return 0;
}
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