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
Answer Posted / 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 |
Post New Answer View All Answers
the real constant in c can be expressed in which of the following forms a) fractional form only b) exponential form only c) ascii form only d) both a and b
Can we access the array using a pointer in c language?
Can we assign string to char pointer?
What does node * mean?
What is extern variable in c with example?
Can you return null in c?
What is a null pointer in c?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What are loops in c?
Explain how can I manipulate strings of multibyte characters?
Why is c called a mid-level programming language?
Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?
What are header files in c programming?
What does d mean?
To print the pattern 1 2 3 4 5 10 17 18 19 6 15 24 25 20 7 14 23 22 21 8 13 12 11 10 9