Question: Assuming the following C code snippet, select all statements that are correct: int main ( ) { int n , j , k; k =
Assuming the following C code snippet, select all statements that are correct:
int main
int n j k;
k ;
for j ; j ; j
k k j;
n fork;
if n or n
k ;
j j ;
else
n k ;
printfd d d
n j k;
return ;
Group of answer choices
The print statement belongs to the child process only
Variables n j k exist in both processes
On the last line of the code, the values of n j k variables are different in the parent and different in the child
The if statement indicates the parent process
fork function is called in order to create a child process by cloning the parent process in a new memory space
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
