Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

What values will be in the question mark symbol in lines 1-4? Please explain how the answer is found? (answer is 5, 0, 1002, 3)

What values will be in the question mark symbol in lines 1-4? Please explain how the answer is found? (answer is 5, 0, 1002, 3)

image text in transcribed

What values will be in the question mark symbol in lines 1-4? Please explain how the answer is found? (answer is 5, 0, 1002, 3)

Question 63 The following program is run. Assume that it's process ID is 1000 and that the next processes created will have process IDs 1001, 1002, 1003, etc. #include #include #include int main() { int i = 3; int child; int status; if((child = fork() == 0) { i= i + 2; printf("X %d %d ", child, i); if((child = fork())==0){ printf("Z %d %d ", child, ++i); return -2; } wait(&status); printf("A%d %d ", child, i); return -1; } wait(&status); printf("Y %d %d ", child, i); return 0; } Assume the output of this program has four lines as shown below. Line 1: XO? Line 2: Z? 6 Line 3: A? 5 Line 4: Y 1001

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server T-SQL Recipes

Authors: David Dye, Jason Brimhall

4th Edition

1484200616, 9781484200612

More Books

Students also viewed these Databases questions

Question

When is it appropriate to use a root cause analysis

Answered: 1 week ago