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
Explain what are multibyte characters?
What is #define size in c?
c language supports bitwise operations, why a) 'c' language is system oriented b) 'c' language is problem oriented c) 'c' language is middle level language d) all the above
What are the 4 types of programming language?
How do you use a 'Local Block'?
What is a good data structure to use for storing lines of text?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
What are 'near' and 'far' pointers?
In a switch statement, explain what will happen if a break statement is omitted?
What is a rvalue?
What is new line escape sequence?
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
What is structure in c definition?
What is define c?
Do you know what are the properties of union in c?