#include "stdio.h"
#include "pthread.h"
#include "sys/types.h"
#include "unistd.h" /* contains fork prototype */ 
int h=5;
void *runner(void *param)
{h+=5;//Statement 1
}
int main()
{     pid_t pid;
  pid=fork();


 if(pid==0)
{ sem_t sem;
 printf("the child\n");
 pthread_t tid; 
  pthread_attr_t attr; 
pthread_attr_init(&attr);
int sem_init(sem_t *sem, int pshared, unsigned 0); 


pthread_create(&tid,&attr,runner,NULL);
pthread_join(tid,NULL);
printf("the number in child%d \n",h)//Statement 2;
int sem_post(sem_t *sem); 


}

else if (pid>0){

int sem_wait(sem_t *sem); 

    printf("the parent \n");
printf("the number in parent%d \n",h);
           exit(0);
}


}
