Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Cells(1, "C").Value d=b*b-4*a*c Sheet1.Cells(2, "A").Value = d End Sub Public Sub timnghiem() Dim x1 As Variant, x2 As Variant, i As String d = Sheet1.Cells(2, "A").Value a = Sheet1.Cells(1, "A").Value b = Sheet1.Cells(1, "B").Value c = Sheet1.Cells(1, "C").Value If d >= 0 Then x1 = (-b + Sqr(d)) / 2 x2 = (-b - Sqr(d)) / 2 Sheet1.Cells(3, "B").Value = x1: Debug.Print x1 Sheet1.Cells(3, "C").Value = x2: Debug.Print x2 Else x1 = "Vo_nghiem" Sheet1.Cells(3, "B").Value = x1 Debug.Print x1 End If End Sub