In its most general use, a function is what a given entity does in being what it is. In C language and other programming, a function is a named procedure that performs a distinct service. The language statement that requests the function is called a function call . These provided functions are sometimes referred to as library routines .
Some functions are self-sufficient and can return results to the requesting program without help.
Other functions need to make requests of the operating system in order to perform their work. In a hardware device, a function is one complete physical movement that has a discernible consequence relative to the device's purposes. In a printer, for example, this might be a carriage return or a line feed.