Explain the need for user-defined functions.
The need for user-defined function:
1. A programmer might be having a block of code that he has repeated forty times all over the program. A function to implement that code would save a great deal of space, and it would also make the program more readable.
2. It is simple to locate and isolate a faulty function. Having only single copy of the code makes it simpler to make changes.