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() { printf("%d, %d", sizeof('c'), sizeof(100)); } a. 2, 2 b. 2, 100 c. 4, 100 d. 4, 4

18 Answers   HCL, IBM, Infosys, LG Soft, Satyam,


main() { char *str1="abcd"; char str2[]="abcd"; printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd")); }

1 Answers  


main() { if ((1||0) && (0||1)) { 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

5 Answers   HCL,


Write a program to check whether the number is prime and also check if it there i n fibonacci series, then return true otherwise return false

1 Answers   Cognizant, lenovo,


#include<stdio.h> main() { struct xx { int x=3; char name[]="hello"; }; struct xx *s=malloc(sizeof(struct xx)); printf("%d",s->x); printf("%s",s->name); }

1 Answers   TCS,






main() { int i=-1; +i; printf("i = %d, +i = %d \n",i,+i); }

1 Answers  


Program to find the largest sum of contiguous integers in the array. O(n)

11 Answers  


Write a C program to print look and say sequence? For example if u get the input as 1 then the sequence is 11 21 1211 111221 312211 12112221 .......(it counts the no. of 1s,2s etc which is in successive order) and this sequence is used in run-length encoding.

1 Answers  


how can i search an element in an array

2 Answers   CTS, Microsoft, ViPrak,


#include<stdio.h> main() { const int i=4; float j; j = ++i; printf("%d %f", i,++j); }

1 Answers  


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


main() { printf("\nab"); printf("\bsi"); printf("\rha"); }

3 Answers  


Categories