#include <stdio.h>
#include "forkjoin.h"
#include "shared.h"int main()
{
int n,nproc,pid;
printf("Enter the number : ");
scanf("%d",&n);
nproc = n/2;
printf("Factors of the Given Number are : \n");
pid = create_process(&nproc);
if(n%(pid+1) == 0)
printf("%d\n",pid+1);
join_process(&nproc,&pid);
return 0;
}
/**************************************************************************
:: OUTPUT ::
Enter the number : 20
Factors of the Given Number are :
1
2
4
10
5