#include <stdio.h>
#include <cstdlib>
#include <unistd.h>
#include <iostream>
#include <stdlib.h>
#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 {
          //parent
          cout << "This is the parent" << endl;
         wait(NULL);
         cout << "Parent address=" << &x << " x=" << x << endl;
          }
 return 0;
}
