What is the main advantage of using exception handling in programming?प्रोग्रामिंग में अपवाद हैंडलिंग का उपयोग करने का मुख्य लाभ क्या है?
प्रोग्रामिंग में अपवाद हैंडलिंग का उपयोग करने का मुख्य लाभ क्या है?
Show answerHide answer
Correct answer: (C) It handles unexpected errors and allows graceful program terminationयह अप्रत्याशित त्रुटियों को संभालता है और सुंदर कार्यक्रम समाप्ति की अनुमति देता है
Explanation
Exception handling catches runtime errors so that the program can recover or end gracefully instead of crashing, using try/except (or try/catch) blocks.Exception handling रनटाइम त्रुटियाँ पकड़ती है ताकि प्रोग्राम क्रैश होने के बजाय उबर सके या शालीनता से समाप्त हो, try/except (या try/catch) ब्लॉक से।