Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Module Module1
- Sub Main()
- Dim a, b, c, delta, x1, x2 As Double
- Console.WriteLine("Podaj parametry a, b i c")
- a = Console.ReadLine()
- b = Console.ReadLine()
- c = Console.ReadLine()
- delta = b * b - 4 * a * c
- If delta > 0 Then
- x1 = (-1 * b + delta ^ (1 / 2)) / 2 * a
- x2 = (-1 * b - delta ^ (1 / 2)) / 2 * a
- Console.WriteLine("Funkcja ma dwa miejsca zerowe: ")
- Console.WriteLine(x1)
- Console.WriteLine(x2)
- End If
- If delta = 0 Then
- x1 = (-1 * b) / (2 * a)
- Console.WriteLine("Funkcja ma jedno miejsce zerowe: ")
- Console.WriteLine(x1)
- End If
- If delta < 0 Then
- Console.WriteLine("Brak miejsc zerowych")
- End If
- Console.ReadLine()
- End Sub
- End Module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement