2081 6

BIT153 ยท 2081 ยท 5 marks

Why do we need to handle exception? Illustrate with an example.

Why do we need to handle exception? Illustrate with an example. [5]

Object Oriented ProgrammingChapter 10: Exception Handling and File I/OException handling definition and purpose

An exception is an abnormal event detected while a program is running, such as a file that will not open, a request for memory that cannot be met, or an argument that makes an operation meaningless. In C++ the code that detects the trouble signals it with throw, and the code that knows what to do...