| | |
Error Throwing In Calculator Code When Divided By '0'
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
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 access algorithm api array asp.net barchart bitmap box broadcast c# check checkbox client combobox control conversion csharp custom database databaseconnection datagrid datagridview dataset datetime dbconnection degrees design development draganddrop drawing encryption enum eventhandlers excel file firefox form format forms function gdi+ grantorrevokepermissionthroughc#.net image index input install java label libraries list listbox loop mandelbrot marshalbyrefobject math mouseclick movingimage mysql mysql.data.client operator path photoshop php picturebox pixelinversion platform post programming radians regex remoting resourcefile richtextbox server sleep socket sql statistics stream string study system.servicemodel table tcpclientchannel text textbox thread time timer update usercontrol validation visualstudio webbrowser windows winforms wpf wpfc# xml






