Functions Functions can do a variety of tasks. Functions are separate units of code that perform a limited but useful task. A function has a function prototype, a function header, and a function body. A function prototype usually goes into a header file.