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 a house diagram in a collaborative manner.
(i) prog1.c
#include
#include
int main()
{
printf( ^^^^^^^^^^^^ );
printf( ^^^^^^^^^^^ ^^^^^^^^^^^ );
printf(^^^^^^^^^^^ ^^^^^^^^^^^ );
printf( | | );
printf( | | );
exit(1);
}
(i) prog2.c
#include
#include
int main()
{
printf( | | );
printf( | | );
printf( | ^^^^^^^^^^^ ^^^^^^^^^^^ | );
printf( | ^ ^ ^ ^ | );
printf( | ^ ^ ^ ^ | );
printf( | ^ ^ ^ ^ | );
exit(1);
}
(i) prog3.c
#include
#include
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started