ok, here is the code....
i could try to make it solve x^3 equations or even x^5...I know u gonna find it easy but not the maths
PS: U should already know how 2 solve quadratic equations to understand this code,First add 3 textboxes named: txtx2, txtx and txtc, also add a label called lblsolutionOption Explicit
Public a As Double
Public b As Double
Public c As Double
Public discriminant As Double
Public sol1 As Double
Public sol2 As Double
____________________________________________
Private Sub cmdsolve_Click()
a = Val(txtx2.Text)
b = Val(txtx.Text)
c = Val(txtc.Text)
discriminant = b ^ 2 - (4 * a * c)
If discriminant < 0 Then
lblsolution.Caption = "There is no solution !"
ElseIf discriminant = 0 Then
sol1 = (-b ) / (2 * a)
lblsolution.Caption = "Solution: " & "x= " & Format(sol1, "0.0000")
Else
sol1 = (-b + Sqr(discriminant)) / (2 * a)
sol2 = (-b - Sqr(discriminant)) / (2 * a)
lblsolution.Caption = "Solution: " & "either: x= " & Format(sol1, "0.0000") & vbCrLf & " or: x= " & Format(sol2, "0.0000")
'Do you have any better suggestions for rounding up the numbers? 3 or 4 dp would do.
End If
End Sub
____________________________________________
Good Luck

.if u need me to explain anything, just say
