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 are the 5 types of inheritance in c ++?

0 Answers  


What are different storage class specifiers in c?

0 Answers  


what is the disadvantage of using macros?

1 Answers   Wipro,


Is c still used?

0 Answers  


What is the result main() { char c=-64; int i=-32 unsigned int u =-16; if(c>i){ printf("pass1,"); if(c<u) printf("pass2"); else printf("Fail2");} else printf("Fail1); if(i<u) printf("pass2"); else printf("Fail2") } a)Pass1,Pass2 b)Pass1,Fail2 c)Fail1,Pass2 d)Fail1,Fail2 e)none

9 Answers   IBM,


why integer range between -327680to+32767

2 Answers  


where do we use structure pointer?

1 Answers  


1.)how to find d most repeated word in a string? string ="how do you do"?? output should be do

1 Answers   AAS, Nagarro, Vuram,


Write a program to display the no of bit difference between any 2 given numbers eg: Num1 will 12->1100 Num2 will 7->0111 the difference in bits are 2.

4 Answers  


What does return 1 means in c?

0 Answers  


Write a program to generate a pulse width frequency of your choise,which can be variable by using the digital port of your processor

0 Answers   TATA, TCS,


Explain what’s a signal? Explain what do I use signals for?

0 Answers  


Categories