Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;+..

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

Consider the following C program. #include <stdio.h> int main() { int i; for (i=0;i<3;+..

Answer / arati

3

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More C Interview Questions

what is the output for the code : main() { int i,j; printf("%d %d ",scanf("%d%d",&i,&j)); }

20 Answers   Infosys,


How can I access memory located at a certain address?

3 Answers   Verizon,


can any one tel me wt is the question pattern for NIC exam

0 Answers   NIC,


What is a memory leak? How to avoid it?

1 Answers  


praagnovation

0 Answers  


What does 3 periods mean in texting?

0 Answers  


What is array within structure?

0 Answers  


Is r written in c?

0 Answers  


Explain what is the difference between a string and an array?

0 Answers  


what about "char *(*(*a[])())();"

3 Answers   Oracle,


What is extern keyword in c?

0 Answers  


What is the difference between call by value and call by reference in c?

0 Answers  


Categories