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

Cau u say the output....?

1 Answers  


write the function. if all the character in string B appear in string A, return true, otherwise return false.

11 Answers   Google,


main() { int i, j; scanf("%d %d"+scanf("%d %d", &i, &j)); printf("%d %d", i, j); } a. Runtime error. b. 0, 0 c. Compile error d. the first two values entered by the user

2 Answers   HCL,


To reverse an entire text file into another text file.... get d file names in cmd line

0 Answers   Subex,


main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }

2 Answers  






write a simple calculator c program to perform addition, subtraction, mul and div.

0 Answers   United Healthcare, Virtusa,


int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }

2 Answers   CSC,


Which one is taking more time and why ? :/home/amaresh/Testing# cat time.c //#include <stdio.h> #define EOF -1 int main() { register int c; while ((c = getchar()) != EOF) { putchar(c); } return 0; } ------------------- WIth stdio.h:- :/home/amaresh/Testing# time ./time_header hi hi hru? hru? real 0 m4.202s user 0 m0.000s sys 0 m0.004s ------------------ Witout stdio.h and with #define EOF -1 =================== /home/amaresh/Testing# time ./time_EOF hi hi hru? hru? real 0 m4.805s user 0 m0.004s sys 0 m0.004s -- From above two case , why 2nd case is taking more time ?

0 Answers  


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


What is your nationality?

1 Answers   GoDB Tech,


I need your help, i need a Turbo C code for this problem.. hope u'll help me guys.? Your program will have a 3x3 array. The user will input the sum of each row and each column. Then the user will input 3 values and store them anywhere, or any location or index, temporarily in the array. Your program will supply the remaining six (6) values and determine the exact location of each value in the array. Example: Input: Sum of row 1: 6 Sum of row 2: 15 Sum of row 3: 24 Sum of column 1: 12 Sum of column 2: 15 Sum of column 3: 18 Value 1: 3 Value 2: 5 Value 3: 6 Output: Sum of Row 1 2 3 6 4 5 6 15 7 8 9 24 Sum of Column 12 15 18 Note: Your program will not necessary sort the walues in the array Thanks..

0 Answers  


#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }

1 Answers  


Categories