Dim x As Single, y As Single, w As Single, n As Single
x = Val(InputBox( x))
n = Val(InputBox( n))
y = Exp(-2 * x) + 1
z = Log(x) / (x + 1)
If x < z ^ 2 Then w = Sqr(x * y) Else w = n * x + 2
Msgbox (w= & w)
End Sub
2. y n x:
.
Sub CommandButton1_Click()
Dim x As Single, n As Single, y As Single
'
x = Val(InputBox(" x "))
n = Val(InputBox(" n"))
'
If x >= 0 And n >= 0 Then y = Sqr(x)
If x < 0 And n < 0 Then y = n * x + 2
MsgBox (y) '
End Sub
3. y x:
.
Sub CommandButton1_Click()
Dim x As Single, y As Single
'
x = Val(InputBox(" x "))
'
If x < 0 Then y = x + 2 Else If x <= 5 Then y = Sqr(5 * x) Else y = x ^ 2
MsgBox (y) '
End Sub
4. y w.
< 5, y=sin2x, w=ctgx; ³ 5, y=1-sinx, w=arctgx. ={9; 0.1; -4; 5; 12}
Private Sub CommandButton1_Click()
Dim x As Single, y As Single, z As Single