What is the output of the following program
#include<stdio.h>
main()
{
int i=0;
fork();
printf("%d",i++);
fork();
printf("%d",i++);
fork();
wait();
}
Answer Posted / sourisengupta
finally we will get 001111.
for the first fork() two 0 will be printed and for secoond
forkk four 1 will be printed.
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
What is spark map function?
How are pointers declared in c?
What is %g in c?
Is c dynamically typed?
What is the modulus operator?
Explain what are header files and explain what are its uses in c programming?
What are 'near' and 'far' pointers?
What is the use of define in c?
i want to know the procedure of qualcomm for getting a job through offcampus
Is main a keyword in c?
What are local static variables? How can you use them?
Can you write the algorithm for Queue?
Can you pass an entire structure to functions?
How is a structure member accessed?
What are extern variables in c?