In reply to dave_59:
Hi Dave,
I had a question. Agreed we need to declare the function as Automatic. But, for this simple example if the code was modified to this below. this would still work right. For cerain applications like Recursion, etc then yes the Function has to be declare Automatic if it is inside a module.
function int divide(int dividend, int divisor);
int i;
i = dividend / divisor; // MOVED TO NEW LINE
return i;
endfunction