hello

when write an algorithm then there is title like
Procedure name(parameter)
My question is that sometimes instead of procedure there is function and sometimes it is procedure... so when i write procedure and when i write function?