Run Code
|
API
|
Code Wall
|
Users
|
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
Please
log in
to post a comment.
If Statement/ Decrement practice
150112_CribaErastotenes
C141106_TablaMultiplicar
B_141205_funciones
Address.c
formatting_input_and_output
BSEARCH() WITH STRUCT
C_141120_factorial01
CPTTRN_2
CO_assign_q1
Please log in to post a comment.