RosettaCodeData/Task/Harmonic-series/CBASIC/harmonic-series.basic
2024-11-04 21:53:44 -08:00

19 lines
307 B
Text

limit = 20
h = 0
print "First";limit;"numbers in the harmonic series"
for i = 1 to limit
h = h + 1 / i
print using "## #.#####"; i; h
next i
for i = 1 to 5
h = 1
n = 2
while h <= i
h = h + 1 / n
n = n + 1
wend
print "Position of first harmonic number >"; i; "is at"; n-1
next i
end