#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>


main()
{
  	pid_t val;

	int cpt1 = 1;
	int cpt2 = 2;

	int i;
	int status = 1;
	int pidc;
	
	if(val = fork()) //parent because it is the parent who call fork()
	{
		pidc = wait(&status);
		while(cpt1 < 20)
		{	
	    		printf("It is the parent- %d - %d\n",(int)getpid(),cpt1);
			cpt1 = cpt1 + 2;
			for(i = 0; i < 500000;i++);
		}
	}
	else //child
	{

		printf("It is the child- %d\n",(int)getpid());
		
			execl("/bin/ls","ls","-l",0);
	}

}

