Question: The following is a code snippet. The output to the screen will be a. Nothing will be printed to screen. b. one line of Task
The following is a code snippet. The output to the screen will be

a. Nothing will be printed to screen.
b. one line of "Task completed".
c. a listing of files and directories in the current directory.
d. a listing of files and directories in the current directory, followed by one line of "Task completed".
e. a listing of files and directories in the current directory, followed by two lines of "Task completed".
pid = fork(); if (pid == 0){ execlp("ls", "ls", "-1", "-a", "-", (char *)0); printf("Task completed "); } else if (pid > 0) { wait (NULL); printf("Task completed "); }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
