Question
What will be the output of the following program.
#include<stdio.h>
int main()
{
int pid;
int retvalue;
int p[2];
pipe(p);
char buff[6]="hello";
pid=fork();
if(pid == 0)
{
exit(0);
}
else
{
sleep(1);
close(p[0]);
retval = write ( p[1], buff);
printf("%d",retval);
}
}
What will be the output of the following program.
#include<stdio.h>
int main()
{
int pid;
int retvalue;
int p[2];
pipe(p);
char buff[6]="hello";
pid=fork();
if(pid == 0)
{
exit(0);
}
else
{
sleep(1);
close(p[0]);
retval = write ( p[1], buff);
printf("%d",retval);
}
}
Answer: Option B
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
More Questions on This Topic :
Question 1.
An assembler is
....
Question 4.
The dispatcher
....
Question 5.
The “blocking factor†of a file is
....
Question 8.
“Throughput†of a system is
....
Question 10.
‘LRU’ page replacement policy is
....
Submit Solution