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
Calculate the weighted average of a list of n numbers using the formula xavg = f1x1+f2x2+ ….+ fnxn where the f’s are fractional weighting factors, i.e., 0<=fi<1, and f1+f2+….+fn = 1
What is difference between stdio h and conio h?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?
What are the uses of a pointer?
Is fortran still used today?
Explain do array subscripts always start with zero?
Can you write the algorithm for Queue?
What is the meaning of ?
State two uses of pointers in C?
What is a pointer and how it is initialized?
What is the condition that is applied with ?: Operator?
What is the difference between ‘g’ and “g” in C?
What is your stream meaning?
How to declare a variable?
I completed my B.tech (IT). Actually I want to develop virtual object that which will change software technology in the future. To develop virtual object what course I have to take. can I any professor to help me.