Option Explicit: Option Base 1
Function FTrBac2(Aa As Double, Bb As Double, Cc As Double)
Dim DelTa: Dim KQua(3, 1)
KQua(1, 1) = "Phuong trình "
DelTa = (Bb ^ 2 - 4 * Aa * Cc)
If DelTa < 0 Then
KQua(1, 1) = KQua(1, 1) & "vô nghiem"
KQua(2, 1) = "Delta có giá tri âm"
ElseIf DelTa > 0 Then
KQua(1, 1) = KQua(1, 1) & "có 2 nghiem:"
KQua(2, 1) = (-Bb + DelTa ^ (1 / 2)) / (2 * Aa)
KQua(3, 1) = (-Bb - DelTa ^ (1 / 2)) / (2 * Aa)
Else
KQua(2, 1) = "có nghiem duy nhât:"
KQua(3, 1) = -Bb / (2 * Aa)
End If
FTrBac2 = KQua
End Function