Dim x As Integer, y As Double
x = Val(InputBox("enter data x:"))
Select Case x
Case Is > 20
y = x ^ 2 + 3 * x + 2
Case Is >= 10 And x <= 20
y = Sqr(3 * x) - 2
Case Is > 0 And x < 10
y = 1 / x + Abs(x)
End Select
Print Format(y, "#.0000")
End Sub