QUADRATIC EQUATION ROOT CALCULATOR WITH COMPLEX ROOT ON
VISUAL BASIC
Hello guys, Iits been a while, I recently wrote a
program in visual basic which calculates the root of a quadratic equation and
think I should share it with you guys.
Ok, here’s the code……..
Module
Module1
Sub Main()
'This is a comment
Console.WriteLine("This is a
Quadratic Calculator")
'Declaring variables
Console.WriteLine("Input a:
")
Dim a As Integer
a = Integer.Parse(Console.ReadLine())
Console.WriteLine("Input b:
")
Dim b As Integer
b = Integer.Parse(Console.ReadLine())
Console.WriteLine("Input c:
")
Dim c As Integer
c = Integer.Parse(Console.ReadLine())
Dim d As Double
Dim e As Double
Dim x1 As Double
Dim x2 As Double
'getting the value in the square root
e = Math.Pow(b, 2) - (4 * a * c)
'checking for equal root, different
roots and complex roots