#include <unistd.h>
#include <iostream>
using namespace std;
int main() {
pid_t pid=fork();

if (pid==0) {
cout<<"child parents " << getppid() << "\n";
sleep(10);
cout<<"child adopted by PID" << getppid() <<"\n";
sleep(1);
} else {
cout<<" parents exists \n";
sleep(3);
_exit(0);
}
}

