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

String copy logic in one line.

11 Answers   Microsoft, NetApp,


main() { int i = 0xff ; printf("\n%d", i<<2); } a. 4 b. 512 c. 1020 d. 1024

2 Answers   HCL,


Write a program to receive an integer and find it's octal equivalent. How can i do with using while loop.

2 Answers  


main ( ) { static char *s[ ] = {“black”, “white”, “yellow”, “violet”}; char **ptr[ ] = {s+3, s+2, s+1, s}, ***p; p = ptr; **++p; printf(“%s”,*--*++p + 3); }

1 Answers  


What is your nationality?

1 Answers   GoDB Tech,






Write a C program to add two numbers before the main function is called.

11 Answers   Infotech, TC,


1 o 1 1 0 1 0 1 0 1 1 0 1 0 1 how to design this function format in c-language ?

2 Answers  


main() { signed int bit=512, i=5; for(;i;i--) { printf("%d\n", bit >> (i - (i -1))); } } a. 512, 256, 0, 0, 0 b. 256, 256, 0, 0, 0 c. 512, 512, 512, 512, 512 d. 256, 256, 256, 256, 256

2 Answers   HCL,


#define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

4 Answers   Google, HCL, Quick Heal, WTF,


PROG. TO PRODUCE 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1

1 Answers  


Write a c program to search an element in an array using recursion

1 Answers   Wipro,


main() { char i=0; for(;i>=0;i++) ; printf("%d\n",i); }

2 Answers  


Categories