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 |
. A database table called PERSON contains the fields NAME, BASIC and HRA. Write a computer program to print a report which employee name and total salary for those employees whose total salary is more than 10,000. Total Salary = BASIC + HRA. At the end, the program should also print the total number of employees whose total salary is more than 10,000.
What will be your course of action for a push operation?
What is a ternary operator in c?
Why do we need arrays in c?
how to execute with out main in cprogram
what will be the output of this program........ main() { int a=2,b=4,c=6; printf("%d"); } why it gives the value of third variable.
What is the best way to store flag values in a program?
program for validity of triangle from 3 side
while running a program, i got the msg that press return key to exit.what that mean in C as there are no such options as far i know.
Is main is a keyword in c?
Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.
what is a NULL Pointer? Whether it is same as an uninitialized pointer?