subject

Using the C program shown below, explain what the output will be at lines X and Y.

#include
#include
#include
#define SIZE 5

int nums[SIZE] = {0,1,2,3,4};

int main()
{
int i;
pid_t pid;
pid = fork();
if (pid == 0) {

for (i = 0; i < SIZE; i++)
{ nums[i] *= -i;
printf("CHILD: %d ",nums[i]); /* LINE X */
}
}

else if (pid > 0) {
wait(NULL);
for (i = 0; i < SIZE; i++)
printf("PARENT: %d ",nums[i]); /* LINE Y */
}
return 0;
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 07:00
You need a quick answer from a coworker. the most effective way to reach your coworker is through a. cloud server b. instant message c. teleconference d. telepresence
Answers: 1
question
Computers and Technology, 23.06.2019 14:00
In which job role will you be creating e-papers, newsletters and preiodicals
Answers: 1
question
Computers and Technology, 23.06.2019 17:30
Per the municipal solid waste report, what are the most common sources of waste (trash
Answers: 3
question
Computers and Technology, 24.06.2019 05:30
Hey i really need some solving this problem: 1. encrypt this binary string into cipher text: 110000. include in your answer the formula the decoder would use to decrypt your cipher text in the format (coded answer) x n mod (m) = y & 2. decrypt this cipher text into a binary string: 106 you.
Answers: 2
You know the right answer?
Using the C program shown below, explain what the output will be at lines X and Y.

#incl...
Questions
question
English, 13.09.2020 08:01
question
Biology, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Biology, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Geography, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
English, 13.09.2020 08:01
question
English, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01
question
Mathematics, 13.09.2020 08:01