Extend the program to create two pipes: one for parent-to-child communication and another for child-to-parent communication. The parent sends a message to the child, the child modifies the message, and sends it back to the parent.
{ int *pipe1,*pipe2; int ret,fret,wret; char wbuff[]="Live Let Live",rbuff[50]; char* res; res=(char*)malloc(sizeof(50)); pipe1=(int*)malloc(sizeof(int)*2); pipe2=(int*)malloc(sizeof(int)*2); ret=pipe(pipe1); ret=pipe(pipe2); printf("Pipe created successfully\n"); fret=fork(); if(fret==-1) { perror("fork"); exit(EXIT_FAILURE); } else if(fret==0) { printf("This is child process with pid:%d\n",getpid()); wret=read(*(pipe1),rbuff,50); printf("parent:%s\n",rbuff); res=toUpper(rbuff); wret=write(*(pipe2+1),rbuff,strlen(rbuff)); } else { printf("This is Parent process with pid:%d\n",getpid()); wret=write(*(pipe1+1),wbuff,strlen(wbuff));