Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose that you have three programs that are suppose to print a house diagram in a collaborative manner. (i) prog1.c #include /* Input/Output */ #include

image text in transcribed

Suppose that you have three programs that are suppose to print a house diagram in a collaborative manner.

(i) prog1.c

#include /* Input/Output */

#include /* General Utilities */

int main()

{

printf( ^^^^^^^^^^^^ );

printf( ^^^^^^^^^^^ ^^^^^^^^^^^ );

printf(^^^^^^^^^^^ ^^^^^^^^^^^ );

printf( | | );

printf( | | );

exit(1);

}

(i) prog2.c

#include /* Input/Output */

#include /* General Utilities */

int main()

{

printf( | | );

printf( | | );

printf( | ^^^^^^^^^^^ ^^^^^^^^^^^ | );

printf( | ^ ^ ^ ^ | );

printf( | ^ ^ ^ ^ | );

printf( | ^ ^ ^ ^ | );

exit(1);

}

(i) prog3.c

#include /* Input/Output */

#include /* General Utilities */

int main()

{

printf( | ^ ^ ^ ^ | );

printf( | ^ ^ ^ ^ | );

printf( | ^ ^ ^ ^ | );

printf( | ^^^^^^^^^^^ ^^^^^^^^^^^ | );

printf( | | );

printf( | | );

printf( ______________________________________________ ); | ");

exit(1);

}

1. Write a c program (name it as house1.c) that draws a 1-story house diagram correctly. Your program should use the following system calls:

fork()

any variant of the exec class system calls

waitpid()

You have to remember prog1.c, prog2.c and prog3.c should be executed in a specific order in a synchronized manner, i.e., prog2 initiates its execution after prog1 is finished and prog3 should be initiated after prog2 is finished!

2. Write a c program (name it as house2.c) that draws a 2-story house diagram correctly. Your program should use the following system calls:

fork()

any variant of the exec class system calls

waitpid()

You have to remember prog1.c, prog2.c and prog3.c should be executed in a specific order in a synchronized manner, i.e., prog2 initiates its execution after prog1 is finished and prog3 should be initiated after prog2 is finished!

1. Write a c progran (nane it as house1.c) that draws a 1-story house diagran correctly. Your pr ogram should use the following system calls: . fork) any variant of the exec class system calls You have to remember Pnshen rbogn sheu d be tiar nrouats itteecution after progt 1s prog1.c, prog2.c and prog3.c should be executed in a specific correctly Your program should use the following systen calls fork( any variant of the exec class system calls You have to romember prog1.c, prog2.c and prog3.c should be executed in a speciric order finished and prog3 should be initiated after prog? is fini shed

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

More Books

Students also viewed these Databases questions