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);
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);
retval = write ( p[1], buff);
printf("%d",retval);
}
}
Answer: Option D
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
More Questions on This Topic :
Question 2.
Symbolic names can be associated with
....
Question 3.
A UNIX device driver is
....
Question 7.
A macro definition consists of
....
Submit Solution