Final answer:
Functions in programming languages enable modularity, reusability, and efficient code management by encapsulating tasks that can be used throughout a program, such as a function to calculate the area of a rectangle.
Step-by-step explanation:
Programming languages have functions because they allow programmers to create modular code, which improves readability, reusability, and efficiency. Functions encapsulate a task or a related group of tasks, thereby enabling the reuse of code, reducing redundancy, and making complex programs easier to manage. A simple example is a function to calculate the area of a rectangle. Rather than repeatedly writing out the formula for area in different parts of a program, a programmer can write a function called calculateArea and simply pass the length and width as parameters whenever the area needs to be calculated.