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 |
How will you print % character? a. printf(“\%”) b. printf(“\\%”) c. printf(“%%”) d. printf(“\%%”)
main() { clrscr(); } clrscr();
plz send me all data structure related programs
main() { int i=-1; -i; printf("i = %d, -i = %d \n",i,-i); }
write a c program to Create a registration form application by taking the details like username, address, phone number, email along with password and confirm password (should be same as password).Ensure that the password is of 8 characters with only numbers and alphabets. Take such details for 5 users and display the details. In place of password display “****”. (Use Structures).
0 Answers CDAC, College School Exams Tests,
main() { extern int i; i=20; printf("%d",sizeof(i)); }
What is the problem with the following code segment? while ((fgets(receiving array,50,file_ptr)) != EOF) ;
how to print 1 2 3 4 5 6 7 8 9 10 9 8 7 6 5 4 3 2 1 using any loop(for or while) only once(only 1 loop) and maximum 2 variables using C.
19 Answers Cap Gemini, Infosys,
int i=10; main() { extern int i; { int i=20; { const volatile unsigned i=30; printf("%d",i); } printf("%d",i); } printf("%d",i); }
how to concatenate the two strings
#include<stdio.h> main() { FILE *ptr; char i; ptr=fopen("zzz.c","r"); while((i=fgetch(ptr))!=EOF) printf("%c",i); }
main() { unsigned int i=65000; while(i++!=0); printf("%d",i); }