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 16:30
How to do this programming flowchart?
Answers: 3
question
Computers and Technology, 24.06.2019 17:00
The length of time that a slide appears before automatically advancing to the next slide can be set in the timing group under the transitions tab. transition to this slide group under the transitions tab. timing group in the master slide view. transition to this slide group in the master slide view.
Answers: 1
question
Computers and Technology, 24.06.2019 21:30
How is a wan different than a lan? both connect computers, but only wan users don’t need the same operating system. both are peer-to-peer networks, but only a wan requires networking hardware. both network computers, but only a wan can cover larger geographical ranges. both connect computers to the internet, but only wan connects to the cloud.
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
Into which of these files would you paste copied information to create an integrated document? a. mailing list b. destination c. source d. data source
Answers: 1
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
World Languages, 11.10.2019 22:00
question
Advanced Placement (AP), 11.10.2019 22:00
question
Biology, 11.10.2019 22:00
Questions on the website: 13722363