pipe is buffer ,have own size of 64k. pipe have two file discriptor. fd[0] for read and fd[1] for write operation. if we try to fd[1] for read and fd[0] for write then it print a garbage value.In pipe first write operation performs ,after that pipe store a value by write function and after that read function will read the value from pipe and print the value.if read function operate first than read function didn't find any value in pipes and read will go in hold position and after than write function works and write in pipe which store value again read function will work and read the data from pipe.