1 задание, пробуйте
#include
#include
#include
const int size = 100;
int main()
{
int fd[2];
char inf_to_send[size];
scanf("%s", inf_to_send);
pid_t p = fork();
pipe(fd);
if (p > 0) {
close(fd[0]);
write(fd[1], inf_to_send, size);
printf("Parent(%d) send str: %s\n", getpid(), inf_to_send);
close(fd[1]);
} else {
close(fd[1]);
read(fd[0], inf_to_send, size);
printf("Child(%d) received str: %s\n", getpid(), inf_to_send);
close(fd[0]);
}
}