Q: how to solve this terminal or code problem #include<stdio.h>
#include<unistd.h>

int main(){
    
    int x;
    pid_t myPID,childPID;
    x=10;
    myPID = getpid();
    childPID=fork();

    printf("%s \n","how are you");
    
    return 0;
}

return ans this format.not print new line.
bobi@bobi-VirtualBox:~/code$ gcc parent_child.c -o parent_child

bobi@bobi-VirtualBox:~/code$ ./parent_child

how are you 

bobi@bobi-VirtualBox:~/code$ how are you 


A: If I understand correctly, you want the child to run in the background and print over the shell after the parent returns? Try:
 childPID=fork();
 if (!childPID) {sleep(1);}
 printf("%s \n","how are you");

