Question: The program printMain prints the following This is a test!!. Given the following code, how many times will the sentence This is a test!! is

The program printMain prints the following This is a test!!. Given the following code, how many times will the sentence This is a test!! is printed?

#include stdio.h

#include uinstd.h

int main() {

int cpid = 0;

char *args[2]={printMain, NULL};

cpid = fork();

execv(printMain,cpid = fork();

cpid = fork();

execv(printMain,cpid = fork();

sleep(10);

return(0);

}

a. 1 b. 2 c. 3 d. 4 e. none of the above

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!