BT Group Interview Question

Write a function that works out n factorial