954,529 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Error Throwing In Calculator Code When Divided By '0'

Plzzzzzzzzzzz Can Anyone Help Me Out Of This Problem By Tomorrow....lookin Forward For Any One So Nice To Help Me Up..saman

saman
Newbie Poster
6 posts since Mar 2006
Reputation Points: 10
Solved Threads: 0
 

Well, since you can't dive by zero, thats why its thorowing the error... You could just use try catch blocks. Or if you post your code, we could help you with better error handling.

If you use try catch block...

try{
//The calculator main code...Where the error is getting thrown
}
catch 
{
MessageBox.Show("You divided by zero...");
//Show the error
}
tayspen
<Insert title here>
Team Colleague
1,622 posts since Jul 2005
Reputation Points: 84
Solved Threads: 99
 
// generate exception
catch (DivideByZeroException e) 
{
   // handle exception
}
_r0ckbaer
Light Poster
45 posts since Dec 2005
Reputation Points: 13
Solved Threads: 7
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You