how many processes will gate created execution of
--------
fork();
fork();
fork();
--------
Please Explain...
Thanks in advance..!
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
Answer / sagar arora
8 because of the rajesh logic but sometimes it fails.
Is This Answer Correct ? | 6 Yes | 10 No |
Cau u say the output....?
write the function. if all the character in string B appear in string A, return true, otherwise return false.
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
To reverse an entire text file into another text file.... get d file names in cmd line
main() { int i; i = abc(); printf("%d",i); } abc() { _AX = 1000; }
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)); }
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 ?
main() { extern out; printf("%d", out); } int out=100;
What is your nationality?
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..
#define FALSE -1 #define TRUE 1 #define NULL 0 main() { if(NULL) puts("NULL"); else if(FALSE) puts("TRUE"); else puts("FALSE"); }