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 realloc in c?
Does c have enums?
write a program that declares an array of 30 elements named "income" in the main functions. then cal and pass the array to a programmer-defined function named "getIncome" within the "getIncome" function, ask the user for annual income of 30 employees. then calculate and print total income on the screen using the following function: "void getIncome ( ai []);
What is non linear data structure in c?
What are header files and explain what are its uses in c programming?
How to explain the final year project as a fresher please answer with sample project
in iso what are the common technological language?
Why calloc is better than malloc?
what are bit fields in c?
I heard that you have to include stdio.h before calling printf. Why?
Explain what does the function toupper() do?
Explain what is the advantage of a random access file?
Explain what is wrong in this statement?
What is the use of getchar() function?
Why c language is called c?