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

main() { if (!(1&&0)) { printf("OK I am done."); } else { printf("OK I am gone."); } } a. OK I am done b. OK I am gone c. compile error d. none of the above

3 Answers   HCL,


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  


What is the output for the program given below typedef enum errorType{warning, error, exception,}error; main() { error g1; g1=1; printf("%d",g1); }

1 Answers  


Design an implement of the inputs functions for event mode

0 Answers   Wipro,


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

8 Answers   GATE,


main() { int i; printf("%d",scanf("%d",&i)); // value 10 is given as input here }

2 Answers   IBM,


#define clrscr() 100 main() { clrscr(); printf("%d\n",clrscr()); }

2 Answers  


main() { char *p; int *q; long *r; p=q=r=0; p++; q++; r++; printf("%p...%p...%p",p,q,r); }

1 Answers  


func(a,b) int a,b; { return( a= (a==b) ); } main() { int process(),func(); printf("The value of process is %d !\n ",process(func,3,6)); } process(pf,val1,val2) int (*pf) (); int val1,val2; { return((*pf) (val1,val2)); }

1 Answers   Satyam,


Display the time of the system and display the right time of the other country

1 Answers  


void main () { int x = 10; printf ("x = %d, y = %d", x,--x++); } a. 10, 10 b. 10, 9 c. 10, 11 d. none of the above

2 Answers   HCL,


main() { int i=10; void pascal f(int,int,int); f(i++,i++,i++); printf(" %d",i); } void pascal f(integer :i,integer:j,integer :k) { write(i,j,k); }

1 Answers  


Categories