18 lines
342 B
Plaintext
18 lines
342 B
Plaintext
100 cls
|
|
110 print "The first twenty harmonic numbers are:"
|
|
120 for n = 1 to 20
|
|
130 h = h+(1/n)
|
|
140 print n,h
|
|
150 next n
|
|
160 print
|
|
170 h = 1
|
|
180 n = 2
|
|
190 for i = 2 to 10
|
|
200 while h < i
|
|
210 h = h+(1/n)
|
|
220 n = n+1
|
|
230 wend
|
|
240 print "The first harmonic number greater than ";i;"is ";h;" at position ";n-1
|
|
250 next i
|
|
260 end
|