Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <unistd.h>
- #include <wait.h>
- int main(void) {
- int pid;
- pid= fork();
- if (pid == 0) {
- fprintf(stdout, "An");
- pid= fork();
- if (pid==0) {
- fprintf(stdout, "Bn");
- pid=fork();
- fprintf(stdout, "Cn");
- }
- else {
- wait(NULL);
- fprintf(stdout, "Dn");
- }
- }
- else {
- fprintf(stdout, "En");
- wait(NULL);
- }
- // your code goes here
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement