Functions are written to reuse block of statements in more than one place in a program. This avoids writing same block of code multiple places. Functions help break our program into smaller and modular chunks. As our program grows larger and larger, functions make it more organized and manageable.
And also it avoids repetition and makes code reusable.