#include <iostream>
#include<stdio.h>
#include<unistd.h>
#include <cstdlib>
#include<sys/wait.h>

using namespace std;

int main(void) {
        int pid=0;
        int x=5;
        pid=fork();
        if (pid==0) {
            //child
            cout<< "This is the child!" <<endl;
             x=x+1;
             cout<< "Child address=" <<&x <<
             "x=" <<x << endl;
             
       }else {
            cout<< "This is the parent !"<< endl;
            wait(NULL);
            cout<<"Parent address="<<&x << "Parent x="<< x << endl;

         //parent
         }
 
return 0;
}

