Using the C program shown below, explain what the output will be at lines X and Y.
#incl...
![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 13.02.2020 22:21 fatboi82
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](/tpl/images/cats/User.png)
Answers: 2
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 21.06.2019 19:30
Which of the following are types of formatting you can apply to a spreadsheet? choose all that apply.
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 06:30
Selective incapacitation is a strategy to reduce prison population
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 22.06.2019 07:30
An endless cycle of creation and response on the internet is called
Answers: 1
You know the right answer?
Questions
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/istoriya.png)
History, 21.05.2020 07:02
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
English, 21.05.2020 07:02
![question](/tpl/images/cats/es.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 21.05.2020 07:02
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
English, 21.05.2020 07:02
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
History, 21.05.2020 07:02
![question](/tpl/images/cats/en.png)
English, 21.05.2020 07:02