Skip to main content
Commonmark migration
Source Link

##QBIC, 13 bytes

QBIC, 13 bytes

[:|c=c+1/a]?c

Explanation

[ |        FOR a = 1 to
 :            the input n
   c=c+    Add to c (starts off as 0)
   1/a     the reciprocal of the loop iterator
]          NEXT
?c         PRINT c

##QBIC, 13 bytes

[:|c=c+1/a]?c

Explanation

[ |        FOR a = 1 to
 :            the input n
   c=c+    Add to c (starts off as 0)
   1/a     the reciprocal of the loop iterator
]          NEXT
?c         PRINT c

QBIC, 13 bytes

[:|c=c+1/a]?c

Explanation

[ |        FOR a = 1 to
 :            the input n
   c=c+    Add to c (starts off as 0)
   1/a     the reciprocal of the loop iterator
]          NEXT
?c         PRINT c
Source Link
steenbergh
  • 8.1k
  • 1
  • 25
  • 41

##QBIC, 13 bytes

[:|c=c+1/a]?c

Explanation

[ |        FOR a = 1 to
 :            the input n
   c=c+    Add to c (starts off as 0)
   1/a     the reciprocal of the loop iterator
]          NEXT
?c         PRINT c