how many processes will gate created execution of
--------
fork();
fork();
fork();
--------
Please Explain...
Thanks in advance..!

Answers were Sorted based on User's Feedback



how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / rajesh

the answer is 8.if n fork calls then no.of processes will
be 2^n

Is This Answer Correct ?    36 Yes 13 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / nishant

7 child process will b created.
Because 1 process ia already present at the start

Is This Answer Correct ?    16 Yes 1 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / abhinav

The process creation at each fork is shown. the number after
fork tells which process is calling fork.
Total 8 processes.

/--1
/---fork1
/ \--5
/-fork1-
/ \ /--3
/ \---fork3
---fork1 \--6
\
| /--2
\ /--fork2--
\ / \--7
\fork2--
\ /--4
\--fork4--
\--8

Is This Answer Correct ?    12 Yes 3 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / rakesh

ya right 8 processes .
For further explanation visit - http://powerboom.blog.co.in

This site gives good explanation .

Is This Answer Correct ?    11 Yes 3 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / sh@n

When under a recursive call 2^n-1 else its 2^n.

Is This Answer Correct ?    2 Yes 0 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / ann

7

Is This Answer Correct ?    6 Yes 5 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / nisha

'8' as formulated by rajesh but in case, fork() used with the combination of && and || operators,,this formula doesn't work...

Is This Answer Correct ?    0 Yes 2 No

how many processes will gate created execution of -------- fork(); fork(); fork(); -------- P..

Answer / sagar arora

8 because of the rajesh logic but sometimes it fails.

Is This Answer Correct ?    6 Yes 10 No

Post New Answer

More C Code Interview Questions

how to return a multiple value from a function?

2 Answers   Wipro,


main() { char * strA; char * strB = I am OK; memcpy( strA, strB, 6); } a. Runtime error. b. I am OK c. Compile error d. I am O

4 Answers   HCL,


why nlogn is the lower limit of any sort algorithm?

0 Answers  


Write a complete program that consists of a function that can receive two numbers from a user (M and N) as a parameter. Then print all the numbers between the two numbers including the number itself. If the value of M is smaller than N, print the numbers in ascending flow. If the value of M is bigger than N, print the numbers in descending flow. may i know how the coding look like?

2 Answers  


main() { char name[10],s[12]; scanf(" \"%[^\"]\"",s); } How scanf will execute?

2 Answers  






#include<conio.h> main() { int x,y=2,z,a; if(x=y%2) z=2; a=2; printf("%d %d ",z,x); }

1 Answers  


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


main() { char *p = “ayqm”; printf(“%c”,++*(p++)); }

29 Answers   IBM, TCS, UGC NET, Wipro,


void main() { int c; c=printf("Hello world"); printf("\n%d",c); }

2 Answers  


main() { float me = 1.1; double you = 1.1; if(me==you) printf("I love U"); else printf("I hate U"); }

1 Answers  


Is the following code legal? struct a { int x; struct a b; }

1 Answers  


what is the code of the output of print the 10 fibonacci number series

2 Answers  


Categories