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
Get step-by-step solutions from verified subject matter experts
