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
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What is meant by initialization and how we initialize a variable?
Do you know what are the properties of union in c?
how to capitalise first letter of each word in a given string?
What is file in c preprocessor?
why wipro wase
Why enum is used in c?
What is logical error?
Multiply an Integer Number by 2 Without Using Multiplication Operator
How is = symbol different from == symbol in c programming?
What should malloc(0) do?
How will you find a duplicate number in a array without negating the nos ?
What is meant by gets in c?
Why do some versions of toupper act strangely if given an upper-case letter?
What is dynamic dispatch in c++?