#include<stdio.h>
#include<unistd.h>
int main()
{
int i = 1;
if(!fork())
{
while(i)
{
printf("Enter i");
scanf("%d",&i);
fflush(stdin);
fflush(stdout);
}
}
else
{
printf("Parent\n");
}
return(0);
}
In the above code scanf works only once. Please help me to find out what wrong i am doing here?