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 |
Want to know how to write a C program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
do ne body have any idea about the salary for the we r going to have interview. yup .. u got it right ..i m talking abt NIC.
What is c definition?
Which is the memory area not included in C program? give the reason
C program code int zap(int n) { if(n<=1)then zap=1; else zap=zap(n-3)+zap(n-1); } then the call zap(6) gives the values of zap [a] 8 [b] 9 [c] 6 [d] 12 [e] 15
main() { intj; while9j<=10) { printf("\n%d",j); j=j+1; } }
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
write a c program for greatest of three numbers without using if statment
Is c++ based on c?
How to create struct variables?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop