DOWNLOAD

Get our toolbar!

Saturday 30 April 2011

// write a program to handle divide by zero exception.


CODE

class Dividebyzero
{
public static void main(String s[])
{
int a =10;
int b =5;
int c =5;
int x;
try
{
x =a/(b-c);
}
catch(ArithmeticException e)
{
System.out.println("divisle by zero"+e);
}
}
}

OUTPUT DISPLAY


0 comments:

Post a Comment

Twitter Delicious Facebook Digg Stumbleupon Favorites More