Question: what is the difference between function and procedure with example?
Answer: Whenever a function is called, it is first compiled before being called. A procedure is compiled once and can be called multiple times without being compiled. A function returns a value and control to calling function or code. A procedure returns the control but not any value to calling function or code.