Question: 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

 Suppose that you have three programs that are suppose to print

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!