PROC Fibonacci(INT n)
  INT a, b, temp, i

  a = 0
  b = 1

  PrintF("Fibonacci sequence up to %I terms:%E", n)
  FOR i = 1 TO n
  DO
    PrintI(a)
    Put(32)
    temp = a + b
    a = b
    b = temp
  OD
  PutE()
RETURN

PROC Main()
  Fibonacci(20)
RETURN
