| | |
Error Throwing In Calculator Code When Divided By '0'
Please support our C# advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
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...
If you use try catch block...
C# Syntax (Toggle Plain Text)
try{ //The calculator main code...Where the error is getting thrown } catch { MessageBox.Show("You divided by zero..."); //Show the error }
Firefox
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
Ewido
Tune up windows
Get detailed system information
My Fixes
Member - Alliance of Security Analysis Professionals - Since 2006
C# Syntax (Toggle Plain Text)
// generate exception catch (DivideByZeroException e) { // handle exception }
![]() |
Similar Threads
- Error 'not all code paths return a value' (C#)
- Triangular number calculator (C)
- Calculator code, pls help (Visual Basic 4 / 5 / 6)
- I got a Link error 1181 with fresh code from source safe. (C++)
- Parse error at last line of page's code (PHP)
- Wierd error messages with calculator program (C++)
Other Threads in the C# Forum
- Previous Thread: Deleting from database
- Next Thread: image manipulation
| Thread Tools | Search this Thread |
.net 2007 access algorithm appportability array bitmap box c# camera check checkbox client combobox control conversion cryptographyc#winformsencryption cs4 csharp customactions database datagrid datagridview dataset datastructure date datetime degrees disabled displayingopenforms draganddrop drawing encryption enum eventcloseformc# excel file form format forms ftp function gdi+ gis image index index-error input install java list listview load math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion pixels post prime programming radians regex remoting richtextbox rotation search security server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation view visual visualstudio webbrowser winforms wordautomation wpf xml






