RosettaCodeData/Task/Sylvesters-sequence/FreeBASIC/sylvesters-sequence.basic

13 lines
302 B
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

Dim As Double sylvester, suma = 0
Print "10 primeros trminos de la sucesi¢n de Sylvester:"
For i As Byte = 1 To 10
sylvester = Iif(i=1, 2, sylvester*sylvester-sylvester+1)
Print Using "##: &"; i; sylvester
suma += 1 / sylvester
Next i
Print !"\nSuma de sus rec¡procos:"; suma
Sleep