RosettaCodeData/Task/Harmonic-series/BASIC256/harmonic-series.basic

19 lines
287 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
h = 0.0
print "The first twenty harmonic numbers are:"
for n = 1 to 20
h += 1.0 / n
print n, h
next n
print
h = 1 : n = 2
for i = 2 to 10
while h < i
h += 1.0 / n
n += 1
end while
print "The first harmonic number greater than "; i; " is "; h; ", at position "; n-1
next i
end