alexcarrega

Exercise 3 of 2018-09-04

Sep 10th, 2018
5,109
0
Never
2
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Function esercizio3(ByVal parametro1 As Integer, ByVal parametro2 As Integer) As Double
  2.     esercizio3 = 0
  3.     Dim conta As Integer
  4.     conta = 0
  5.     Dim i As Integer
  6.     For i = parametro1 To parametro2
  7.         If 1 <> 0 Then
  8.             esercizio3 = esercizio3 + (1 / i)
  9.             conta = conta + 1
  10.         End If
  11.     Next i
  12.     esercizio3 = esercizio3 / conta
  13. End Function
Advertisement