Page 1 of 1

What output will be at Line X, Line Y and Line Z? #include #include #include #define

Posted: Fri Jul 08, 2022 6:35 am
by answerhappygod
What Output Will Be At Line X Line Y And Line Z Include Sys Types H Include Stdio H Include Unistd H Define 1
What Output Will Be At Line X Line Y And Line Z Include Sys Types H Include Stdio H Include Unistd H Define 1 (143.01 KiB) Viewed 27 times
What Output Will Be At Line X Line Y And Line Z Include Sys Types H Include Stdio H Include Unistd H Define 2
What Output Will Be At Line X Line Y And Line Z Include Sys Types H Include Stdio H Include Unistd H Define 2 (92.01 KiB) Viewed 27 times
Please answer asap.operating system
What output will be at Line X, Line Y and Line Z? #include <sys/types.h> #include <stdio.h> #include <unistd.h> #define SIZE 4 int nums[SIZE] = {-6, 12, -18, 24); int main() { int i; pi_t pid fork(); if (pid == 0) { for (i = 0; i < SIZE; i++) { nums = nums* i-8; = printf("CHILD: %d ",nums); /* LINE X */ pi_t pid_1= fork(); if(pid_1= = 0){ for (i = 0; i < SIZE; i++) { nums *= i+4; printf("CHILD: %d ", nums); /* LINE Y */ } else if (pid > 0) { wait(NULL); for (i = 0; i < SIZE; i++){ nums + = 4i; printf("PARENT: %d ",nums); /* LINE Z*/} } return 0; } } }
a. False What resources are used when a thread is created? How do they differ from those used when a process is created? [2] Explain the role of the init (or systemd) process on UNIX and Linux systems in regard to process termination. [2]