Home » Technical Questions » Operating Systems

main() { fork(); printf(“Hello World!”); } Output for the above unix program is

Correct Answer: Hello World!Hello World!

Explanation:

The fork creates a child that is a duplicate of the parent process. The child begins from the fork().All the statements after the call to fork() will be executed twice.(once by the parent process and other by child). The statement before fork() is executed only by the parent process


← Previous Question Next Question→

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion