Difference between Program and Function
1. Program :
Program, as name suggest, are set or collection of instructions used by computer to execute specific task and these are created using particular programming languages such as C++, Python, Ruby, etc.
2. Function :
Function, as name suggests, is basic concept in computer programming that one calls to control flow of program as well as perform a specific task, returns a value and resumes program where it was called.
Difference between Program and Function :
|Programs are set of instructions executed by computer.||Function is block of organized and reusable code.|
|Programs has to instruct computer to do particular task.||Functions has to perform action or related action.|
|Programs do not return any result.||Function usually return result that can be graphed or entered in table.|
|It provides framework that set direction of program as well as plan about how objective will be achieved.||It provides better modularity for application as well as high degree of reusing code.|
|It cannot store local and global variables.||It can store local and global variables.|
|Types of programs include system programs, application programs, utility programs, etc.||Types of function include modulus function, linear function, quadratic function, exponential function, etc.|
|Program consists of compiled code that run directly from computers operating system.||Functions can be used over and over again once it is defined.|
|It is larger in size and does not require scripting engine to run.||Functions are smaller in size as compared to programs.|
|Programs are written in both low-level and high-level programming languages and are human readable and writable.||Functions can be both low-level or top-level functions.|