0 0 votes Consider the following program. #include<stdio.h> #include<stdlib.h> #include<unistd.h> int main(void) { pid_t pid; int varl = 100; pid = fork(); if(pid == 0) /* Child process */ varl = 200; fork(); printf(“%d”, varl); return 0; } Assuming all invocations of fork are successful, which of the following is a correct output when the program is executed on the $\text{UNIX OS}?$ $100 \; 100 \; 200 \; 200$ $200 \; 200 \; 200 \; 200$ $100 \; 100 \; 100 \; 100$ $100 \; 200 \; 200 \; 200$ Operating System uppcl2018 operating-system system-calls fork-system-call + – admin 751 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
0 0 votes 100 100 200 200 a DeadMann answered Oct 4, 2022 DeadMann comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes Answer is option A. 100 100 200 200 chetan-naik answered Sep 21, 2024 chetan-naik comment Share Follow 0 reply Please log in or register to add a comment.