Dim a As Double, x As Double, h As Double, y As Double a = 10: h = 0.2: x=-1 Do While x <= 1 y = (2 * a + x) / (3 * a - x) Print Using "##.#"; x; Print Using " ###.########"; y: x=x+h Loop
1 votes Thanks 0
Лириэль
Должно быть примерно так: Sub number3() Dim a As Single, h As Single, x As Single, F As Single Dim S As String a = 10 h = 0.2 x = -1 S = " " 'Начало цикла с предусловием Do While -1 <= x <= 1 F = Format((2 * a + x) / (3 * a - x), "FIXED") S = S + " " + Str(F) S = a + h + x Loop MsgBox "S= " & S, vbInformation, "Значения функции" End Sub
Лириэль
Так или иначе,то что написали вы не запускается
Answers & Comments
Verified answer
Dim a As Double, x As Double, h As Double, y As Doublea = 10: h = 0.2: x=-1
Do While x <= 1
y = (2 * a + x) / (3 * a - x)
Print Using "##.#"; x;
Print Using " ###.########"; y: x=x+h
Loop
Dim a As Single, h As Single, x As Single, F As Single
Dim S As String
a = 10
h = 0.2
x = -1
S = " "
'Начало цикла с предусловием
Do While -1 <= x <= 1
F = Format((2 * a + x) / (3 * a - x), "FIXED")
S = S + " " + Str(F)
S = a + h + x
Loop
MsgBox "S= " & S, vbInformation, "Значения функции"
End Sub