You are building a simple event handling system where different event codes (0 to 4) trigger different actions.
Each event type corresponds to a specific function:
| Event Code | Trigger Type | Function |
| 0 | Button Press | on_button() |
| 1 | Timer Expire | on_timer() |
| 2 | UART Received | on_uart() |
| 3 | Power On | on_power() |
| 4 | Error Detected | on_error() |
You must:
- Implement a function pointer array
- Trigger the correct function based on the input event code
- If the code is outside the 0–4 range, print "Unhandled Event"
Example-1
Input: 1
Output: Timer Expired
Example-2
Input: 3
Output: Power On
Example-3
Input: 5
Output: Unhandled Event