Convert the following mathematical expression to visual basic formula
(1) -b ± √b²-4ac÷2a
(2) pr²÷√q²+s²
1
Dim a As Double
Dim b As Double
Dim c As Double
Dim root1 As Double = ((-1) * b + Math.Sqrt(b * b - 4 * a * c)) / (2 * a)
Dim root2 As Double = ((-1) * b - Math.Sqrt(b * b - 4 * a * c)) / (2 * a)
2
Dim p As Double
Dim r As Double
Dim q As Double
Dim s As Double
Dim result As Double = p * r * r / (Math.Sqrt(q * q) + s * s)
Comments
Leave a comment