Question: what is the difference between function and sub procedure?
Answer: A function is similar to a sub procedure in the sense that both are called by the main procedure to fulfill certain tasks. However, there is one difference, a function returns a value whilst a sub procedure does not.