What is the purpose of a try-catch block?
Q1. What is the purpose of a try-catch block?
Answer: To handle runtime errors
Explanation: A try-catch block is used to handle runtime errors by catching exceptions and executing alternative code, preventing program crashes and improving robustness.