2
Most read
3
Most read
8
Most read
1
CONTENT :
• INTRODUCTION
• TRY ,THROW,CATCH
• SYNTAX
• EXAMPLE
2
INTRODUCTION :
Exception Handling :
It is a way of handling error which occure while executing
program.
Exception are run time unusual condition that a program may
encounter while executing..
This unusual condition includes condition such as “division by
zero”,””, or “running out of memory or disk space”.
3
CONTIN….
TRY :
It is one of the block in which we write the block of
statements which causes executions at run time in
other words try block always contains problematic
statements.
4
CONTIN….
THROW BLOCK:
5
A throw expression signals that an exceptional
condition—often, an error—has occurred in a try block
CONTIN….
CATCH BLOCK:
It is one of the block in which we write the block of
statements which will generates user friendly error
messages in other words catch block will suppose system
error messages.
6
In an program a block of code which can produce error is placed in try block
When an exception is detected in try it is thrown using throw statement
Syntax
try
{
throw exception;
}
catch(type argument)
{
}
SYNTAX
7
Relating exception handling with real life
If a Smartphone fails the
test
try throw
catch
8
PROGRAM
#include <iostream>
#include <conio.h>
using namespace std;
Int main()
{
 int dividend, divisor, quotient;
 try
 {
 cout << " Enter the dividend: ";
 cin >> dividend;
 cout << "Enter the divisor: ";
9
CONTIN…..
 cin >> divisor;
 if (divisor == 0)
 throw divisor;
 quotient = dividend / divisor;
 cout << "Quotient = " << quotient << endl;
 }
 catch (int x)
 {
cout << "Division by "<< x << endl;
 }
}
10
PROGRAM
exception.cpp
11
Thank you
12

More Related Content

PPTX
Parity Generator and Parity Checker
PPTX
Exception Handling in object oriented programming using C++
DOCX
SIMPLE RESUME FORMAT
PDF
Fault tolerance
PPTX
Exception handling
DOCX
Virtual reality report
PPTX
FLOOD PPT 1.pptx
PDF
NPK Fertilizer: What is it and How Does it Work
Parity Generator and Parity Checker
Exception Handling in object oriented programming using C++
SIMPLE RESUME FORMAT
Fault tolerance
Exception handling
Virtual reality report
FLOOD PPT 1.pptx
NPK Fertilizer: What is it and How Does it Work

What's hot (20)

PPTX
Exception Handling in Java
PPTX
Exception handling c++
PPTX
Java exception handling
PPTX
Presentation on-exception-handling
PDF
Java exception handling ppt
PPTX
String, string builder, string buffer
PPTX
Python Exception Handling
PPT
Exception handling
PPTX
Dynamic memory allocation
PPTX
Exception Handling in VB.Net
PPTX
Classes objects in java
PPTX
Functions in c++
PPTX
java interface and packages
PDF
Exception handling
PDF
StringTokenizer in java
PPTX
Fundamentals of OOP (Object Oriented Programming)
PDF
Arrays in Java
PPT
Operators in C++
PPT
Serialization/deserialization
Exception Handling in Java
Exception handling c++
Java exception handling
Presentation on-exception-handling
Java exception handling ppt
String, string builder, string buffer
Python Exception Handling
Exception handling
Dynamic memory allocation
Exception Handling in VB.Net
Classes objects in java
Functions in c++
java interface and packages
Exception handling
StringTokenizer in java
Fundamentals of OOP (Object Oriented Programming)
Arrays in Java
Operators in C++
Serialization/deserialization
Ad

Similar to Exception handling in c++ (20)

PPT
Exception
PPTX
PPTX
Exception handling.pptxnn h
PPTX
ACP - Week - 9.pptx
PPTX
Exception handling in java
PPTX
Exception handling
PPTX
UNIT III 2021R.pptx
PPTX
UNIT III 2021R.pptx
PPTX
OOPs & C++(UNIT 5)
PPTX
Week 4 - 5 Debugging Code and Analyzing Logic Errors.pptx
ODP
Exception handling in java
PPTX
Java Exceptions and Exception Handling
PPTX
PPTX
What is Exception Handling?
PDF
22 scheme OOPs with C++ BCS306B_module5.pdf
PPTX
Lecture 1 Try Throw Catch.pptx
PPTX
java.pptx
PPTX
Exception Handling,finally,catch,throw,throws,try.pptx
PPTX
Exception handling with python class 12.pptx
PPT
Exception handling
Exception
Exception handling.pptxnn h
ACP - Week - 9.pptx
Exception handling in java
Exception handling
UNIT III 2021R.pptx
UNIT III 2021R.pptx
OOPs & C++(UNIT 5)
Week 4 - 5 Debugging Code and Analyzing Logic Errors.pptx
Exception handling in java
Java Exceptions and Exception Handling
What is Exception Handling?
22 scheme OOPs with C++ BCS306B_module5.pdf
Lecture 1 Try Throw Catch.pptx
java.pptx
Exception Handling,finally,catch,throw,throws,try.pptx
Exception handling with python class 12.pptx
Exception handling
Ad

More from imran khan (10)

PPTX
Business plan
PPTX
resistors
PPT
ohm's law and circuits
PPTX
Ideology of pakistan
PPTX
Intelligence
PPTX
Matrix transapose in c++
PPTX
limits and continuity
PPTX
inline function
PPTX
Data mining
PPTX
Software Engineering tools
Business plan
resistors
ohm's law and circuits
Ideology of pakistan
Intelligence
Matrix transapose in c++
limits and continuity
inline function
Data mining
Software Engineering tools

Recently uploaded (20)

PPTX
Advanced Heap Dump Analysis Techniques Webinar Deck
PDF
OpenAssetIO Virtual Town Hall - August 2025.pdf
PPTX
SQL introduction and commands, SQL joining
PPTX
oracle_ebs_12.2_project_cutoveroutage.pptx
PPTX
Relevance Tuning with Genetic Algorithms
PDF
Science is Not Enough SPLC2009 Richard P. Gabriel
PDF
OpenColorIO Virtual Town Hall - August 2025
PPT
introduction of sql, sql commands(DD,DML,DCL))
PDF
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
PPTX
AI Tools Revolutionizing Software Development Workflows
PDF
Difference Between Website and Web Application.pdf
PDF
Multiverse AI Review 2025_ The Ultimate All-in-One AI Platform.pdf
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
PPTX
TRAVEL SUPPLIER API INTEGRATION | XML BOOKING ENGINE
PDF
WhatsApp Chatbots The Key to Scalable Customer Support.pdf
PDF
IDM Crack Activation Key 2025 Free Download
PPTX
Presentation - Summer Internship at Samatrix.io_template_2.pptx
PPTX
UNIT II: Software design, software .pptx
PDF
IObit Driver Booster Pro Crack Latest Version Download
PPTX
SIH2024_IDEA_dy_dx_deepfakedetection.pptx
Advanced Heap Dump Analysis Techniques Webinar Deck
OpenAssetIO Virtual Town Hall - August 2025.pdf
SQL introduction and commands, SQL joining
oracle_ebs_12.2_project_cutoveroutage.pptx
Relevance Tuning with Genetic Algorithms
Science is Not Enough SPLC2009 Richard P. Gabriel
OpenColorIO Virtual Town Hall - August 2025
introduction of sql, sql commands(DD,DML,DCL))
DOWNLOAD—IOBit Uninstaller Pro Crack Download Free
AI Tools Revolutionizing Software Development Workflows
Difference Between Website and Web Application.pdf
Multiverse AI Review 2025_ The Ultimate All-in-One AI Platform.pdf
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
TRAVEL SUPPLIER API INTEGRATION | XML BOOKING ENGINE
WhatsApp Chatbots The Key to Scalable Customer Support.pdf
IDM Crack Activation Key 2025 Free Download
Presentation - Summer Internship at Samatrix.io_template_2.pptx
UNIT II: Software design, software .pptx
IObit Driver Booster Pro Crack Latest Version Download
SIH2024_IDEA_dy_dx_deepfakedetection.pptx

Exception handling in c++

  • 1. 1
  • 2. CONTENT : • INTRODUCTION • TRY ,THROW,CATCH • SYNTAX • EXAMPLE 2
  • 3. INTRODUCTION : Exception Handling : It is a way of handling error which occure while executing program. Exception are run time unusual condition that a program may encounter while executing.. This unusual condition includes condition such as “division by zero”,””, or “running out of memory or disk space”. 3
  • 4. CONTIN…. TRY : It is one of the block in which we write the block of statements which causes executions at run time in other words try block always contains problematic statements. 4
  • 5. CONTIN…. THROW BLOCK: 5 A throw expression signals that an exceptional condition—often, an error—has occurred in a try block
  • 6. CONTIN…. CATCH BLOCK: It is one of the block in which we write the block of statements which will generates user friendly error messages in other words catch block will suppose system error messages. 6
  • 7. In an program a block of code which can produce error is placed in try block When an exception is detected in try it is thrown using throw statement Syntax try { throw exception; } catch(type argument) { } SYNTAX 7
  • 8. Relating exception handling with real life If a Smartphone fails the test try throw catch 8
  • 9. PROGRAM #include <iostream> #include <conio.h> using namespace std; Int main() {  int dividend, divisor, quotient;  try  {  cout << " Enter the dividend: ";  cin >> dividend;  cout << "Enter the divisor: "; 9
  • 10. CONTIN…..  cin >> divisor;  if (divisor == 0)  throw divisor;  quotient = dividend / divisor;  cout << "Quotient = " << quotient << endl;  }  catch (int x)  { cout << "Division by "<< x << endl;  } } 10