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
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is call by value in c?
Is c weakly typed?
State the difference between realloc and free.
Where is c used?
What is the difference between the local variable and global variable in c?
What is sizeof c?
Which header file is essential for using strcmp function?
What is the difference between far and near ?
When can a far pointer be used?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What are near, far and huge pointers?
What is the purpose of type declarations?
Explain how does free() know explain how much memory to release?
#include main() { enum _tag{ left=10, right, front=100, back}; printf("left is %d, right is %d, front is %d, back is %d",left,right,front,back); }