Why we use function in C?

Functions are used for dividing a large code into module, due to this we can easily debug and maintain the code. For example if we write a calculator programs at that time we can write every logic in a separate function. Any function can be called many times.

Advantages of Function
  • Code Reusuability
  • Develop an application in module format
  • Easy to debug the program
  • Code optimization: no need to write a lot of code
  • Code is easier to read
  • Program testing becomes easier
  • Compiled executable is smaller
  • You don't need to make comments because function name make sense
  • Program can be developed in short period of time
  • There is no chance of code duplication
Tags

Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.

If you have any doubt, let me know...