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

20 lines
307 B
Text
Raw Permalink Normal View History

2024-10-16 18:07:41 -07:00
limit = 20
h = 0
print "First";limit;"numbers in the harmonic series"
2024-11-04 20:28:54 -08:00
for i = 1 to limit
2024-10-16 18:07:41 -07:00
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