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 / raghu
totally 8 processes...so each process will print 0 & 1
output: 0101010101010101
| Is This Answer Correct ? | 6 Yes | 1 No |
Post New Answer View All Answers
If jack lies on Mon, Tue Wed and jill lies on Thursday, Friday and Saturday. If both together tell they lied yesterday. So c the given options and then c cos in the given dates one will be saying the truth and one will be lying. I got Thursday as option because jack is saying the truth he lied yest but jill is lying again as he lies on that day.
Can you please explain the scope of static variables?
What is the difference between declaring a variable by constant keyword and #define ing that variable?
Which is better malloc or calloc?
What do you mean by Recursion Function?
hi any body pls give me company name interview conduct "c" language only
which is conditional construct a) if statement b) switch statement c) while/for d) goto
Is it acceptable to declare/define a variable in a c header?
What is #error and use of it?
How do you define a function?
What is character constants?
Explain threaded binary trees?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
Explain 'bus error'?
Can we replace the struct function in tree syntax with a union?