
Example 2:
In this program, the parent process creates multiple child processes, and each child process prints its own process ID (PID) along with the parent’s PID.

In this program:
The parent process creates num_processes child processes using fork().
Each child process prints its own PID and the parent’s PID.
The parent process waits for all child processes to finish using wait().

-----------------------------------
Let's create a simple numerical program that calculates the sum of numbers from 1 to N, where N is provided by the user. We'll use fork() to parallelize the computation by splitting it into two separate processes, each responsible for calculating half of the sum. The parent process will then combine the results from both child processes to get the total sum. Here's the code:
