#include #include int main(int argc, char *argv[]) { pid_t pid; char c; if ((pid = fork()) < 0) { // error occured fprintf(stderr, "Fork failed\n"); return 1; } else if (pid == 0) { // child process printf("in Child process, type a char to continue ...\n"); scanf("%c", &c); execlp("/bin/ls", "ls", NULL); } else { // parent process printf("in Parent process, waiting for Child process to complete ...\n"); wait(NULL); printf("Child completed\n"); printf("in Parent process, type a char to complete ...\n"); scanf("%c", &c); } return 0; }