A function is a named block of code that performs a specific task. The function header contains the return type, name, and parameters. The function body contains the code that is executed when the function is called. Functions make code reusable and easier to maintain. Variables declared inside a function are local and can only be accessed within the function. Variables declared outside functions are global and can be accessed throughout the program. Arrays store multiple values of the same type and allow accessing elements via an index. One-dimensional arrays use a single index while two-dimensional arrays use two indexes.