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, 22.06.2019 02:00
Aletter or menu command that starts an action when the user presses the designated letter and the alt key together is called what?
Answers: 1
question
Computers and Technology, 22.06.2019 11:30
Andrina writes letters that are regularly sent to hundreds of her companyโ€™s customers. because of this, she would like for the mail merge command to be in her quick access toolbar, and she wants it to be the first button on the left. what should andrina do to place the mail merge button there?
Answers: 1
question
Computers and Technology, 23.06.2019 07:30
What is the original authority for copyright laws
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
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
Social Studies, 29.08.2020 19:01
Questions on the website: 13722361