Multiple choice technology operating systems

Output of below code is: main() { fork(); fork(); fork(); printf("Hello"); }

  1. "Hello" will be printed 3 times

  2. "Hello" will be printed 4 times

  3. "Hello" will be printed 8 times

  4. Error

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

Each fork() call creates a new process, doubling the number of processes. After 3 fork() calls: 1 → 2 → 4 → 8 processes. All 8 processes execute the printf statement, so 'Hello' prints 8 times. This is a classic process creation demonstration in UNIX systems.