Consider the following C program.
#include <stdio.h>
int main() {
int i;
for (i=0;i<3;++i) {
fork();fork();
}
}
How many processes are created when running this program
(including the initial one)?
Explain
Answers were Sorted based on User's Feedback
Answer / chetan raikwar
According to me, Total 6 processes.
1- execution of main() along with included library<stdio.h>.
2- declaration of 'i' as type 'int'.
3- for (i=0;i<3;++i)
4- fork();
5- fork(); (since two separate function will be executed separately whether it's a loop or not.
5- Termination of main function. }
| Is This Answer Correct ? | 0 Yes | 0 No |
what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }
How can I access memory located at a certain address?
can any one tel me wt is the question pattern for NIC exam
What is a memory leak? How to avoid it?
praagnovation
What does 3 periods mean in texting?
What is array within structure?
Is r written in c?
Explain what is the difference between a string and an array?
what about "char *(*(*a[])())();"
What is extern keyword in c?
What is the difference between call by value and call by reference in c?