#include #include #include #include using namespace std; int main() { for (int i = 0; i < 4; i++) { fork(); cout << "Process pid=" << getpid() << " has i=" << i << endl; } wait(NULL); // cout << getpid() << " exiting " << endl; }