Hi I wrote the following program
[code=c]int main()
{
//pid_t cpid,ppid;
unsigned int status;
if(fork() == 0){
printf("\nChild Process ID%d",getpid()) ;
scanf("\nEnter The Status:%d",&sta tus);
exit(status);
}
else
{
wait(&status);
printf("\nParen t Process ID%d",getpid()) ;
printf("\nChild exit status =%d\n",status > 8);
}
}[/code]
when i executing the line
[code=c]scanf("\nEnter The Status:%d",&sta tus);[/code] is not executing.
and then always it gives the child exit status 1
What is the reason for this one?
plz clarify me
Thanks
					[code=c]int main()
{
//pid_t cpid,ppid;
unsigned int status;
if(fork() == 0){
printf("\nChild Process ID%d",getpid()) ;
scanf("\nEnter The Status:%d",&sta tus);
exit(status);
}
else
{
wait(&status);
printf("\nParen t Process ID%d",getpid()) ;
printf("\nChild exit status =%d\n",status > 8);
}
}[/code]
when i executing the line
[code=c]scanf("\nEnter The Status:%d",&sta tus);[/code] is not executing.
and then always it gives the child exit status 1
What is the reason for this one?
plz clarify me
Thanks
Comment