Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
child process
#include<stdio.h> #include<stdlib.h> #include<unistd.h> int main() { int n; scanf("enter n times %d,n); while(n!=0) { for(int i=0;i<n;i++) { if(fork() == 0) { printf("[son] pid %d from [parent] pid %d\n",getpid(),getppid()); exit(0); } n--; } } for(int i=0;i<n;i++) wait(NULL); }
run
|
edit
|
history
|
help
0
19_1_7
C_141120_factorial02
Even odd program
Largest and Second Largest number in an array
1
mapOfIndia
alphabet2 pyramid right
printing float 2 pointers
Prime
Array non repeated alphabets