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

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


Please Help Members By Posting Answers For Below Questions

How do I create a directory? How do I remove a directory (and its contents)?

1176


How can I read/write structures from/to data files?

979


What is the difference between constant pointer and constant variable?

1235


what are # pragma staments?

2050


Is python a c language?

1020


Describe the complexity of Binary search, Quicksort and various other sorting and searching techniques..

1043


Explain about the constants which help in debugging?

1382


How can a program be made to print the line number where an error occurs?

1089


When is a “switch” statement preferable over an “if” statement?

1161


Why we not create function inside function.

2210


In which language linux is written?

1236


How do you do dynamic memory allocation in C applications?

1093


Why we write conio h in c?

1046


How do you define a string?

1112


Can the “if” function be used in comparing strings?

1062