How many processes will be created when the following program is executed? Assume that all fork() system calls are succe
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
How many processes will be created when the following program is executed? Assume that all fork() system calls are succe
How many processes will be created when the following program is executed? Assume that all fork() system calls are successful. What will be printed? main() { = int i = 3; int ret_val; while(i > 0) { if ((ret_val fork()) == 0) { printf("In child %d. \n", i); exit(0); } else { printf("In parent %d. \n", i); i = i - 1; } } }
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!