#include #include #include using namespace std; int main() { pid_t id{fork()}; int status; for(int i=0;i < 1000; i++) { cout << id <<":"<< i << " "; cout.flush(); } if (id > 0) { wait(&status); cout << endl; } return 0; }