1
0
UAHCode/CPE435/Lab1/demo_3.cpp

19 lines
331 B
C++
Raw Normal View History

2022-08-28 21:12:16 +00:00
/* This program illustrates multiple fork operations */
#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <unistd.h>
using namespace std;
int main()
{
printf("I am the Parent\n");
fork();
printf("This is printed by both parent and child\n");
fork();
printf("This will be printed 4 times\n");
return 0;
}