Task

Compute the sum and product of an array of integers.




          t = table()
* read the integer from the std. input
init_tab  t<x = x + 1> = trim(input)    :s(init_tab)
          product = 1
          sum = 0
 
* counting backwards to 1
loop      i = t< x = ?gt(x,1) x - 1>	:f(out)
          sum = sum + i
          product = product * i         :(loop)
out       output = "Sum:  " sum
          output = "Prod: " product
end