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, 21.06.2019 16:00
This statement accurately describes how headlines should be placed in business documents.
Answers: 3
question
Computers and Technology, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 01:50
Create a class named majors that includes an enumeration for the six majors offered by a college as follows: acc, chem, cis, eng, his, phys. display the enumeration values for the user, then prompt the user to enter a major. display the college division in which the major falls. acc and cis are in the business division, chem and phys are in the science division, and eng and his are in the humanities division. save the file as majors.java.
Answers: 2
question
Computers and Technology, 24.06.2019 08:00
Java the manager of a football stadium wants you to write a program that calculates the total ticket sales after each game
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
Mathematics, 08.12.2020 20:50
question
History, 08.12.2020 20:50
question
Physics, 08.12.2020 20:50
question
Arts, 08.12.2020 20:50
Questions on the website: 13722367