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
What is c definition?
int i[2], j; int *pi;i[0] = 1; i[1] = 5; pi = i; j = *pi + 1 + *(pi + 1)Value of j after execution of the above statements will be a) 7 b) 6 c) 4 d) pointer
What is derived datatype in c?
A variable that is defined in a specified portion of a program but can be used throughout the program a) global variable b) local variable c) character d) none
What is the use of bit field?
How can you return multiple values from a function?
Can 'this' pointer by used in the constructor?
What is your stream meaning?
What do you mean by Recursion Function?
Can I initialize unions?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
write a program to print largest number of each row of a 2D array
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What are the storage classes in C?
What is scope of variable in c?