Join With Me...

3:21 AM

Fork IPC program in C

main()
{
 int a[2];
int b[6]={1,2,3,4,5,6};
int p,tem1=0,tem2=0,i,j;
{
p=fork();
if(p==0)
{
for(j=0;j<6;j+=2)
printf("%d  \n  ", b[j]);
}
else
{
for(j=1;j<6;j+=2)
printf("%d  \n  ", b[j]);
}
}
printf("%d   %d",tem1, tem2);
}

0 comments:

Post a Comment