=== Program === // copied from K: tests/diverse/factorial.simple // The following program calculates the factorial of a user-provided number. function factorial(y) { print("Factorial of ", y, " is: "); var t=1; for(var i=1; i<=y; ++i) { t = t*i; } return t; } function main() { print("Input a natural number: "); print(factorial(read()),"\n"); } === Output === Result: null-value Output Entity: standard-out "Input a natural number: ","Factorial of ",5," is: ",120,"\n"