oogabooga
thanku .... do u mean like this ....
but still therer is error ....
Code:
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
int N;
pid_t pid;
int cont;
if (argc != 2) {
printf("Wrong number of command-line parameters!\n");
return 1;
}
N = atoi(argv[1]);
printf("Creating process sequence of length %d.\n",N);
printf("%d begins the sequence.\n",getpid());
/* What I have to do next ?????? */
for(cont=0;cont>N;cont++)
{
if(fork() == 0){
printf("%d is child of %d \n",getpid(),getppid());
}
}
}