Working of Functions and main( )
That is, when the program control reaches the function call f1( ) then it transfers control to the
function f1( ) (on the right-hand side), where on encountering a return statement, control returns back
to the main( ) function.
Why We Need Functions
1. It is easier to write and debug functions than with a large monolithic program.
2. There is no repetition of code, as we can call functions wherever we want.
3. Functions are portable and can be run on any system.
4. A lot of time and memory resources are saved.
5. Modularization is achieved easily.
6. Program length becomes smaller.
Do'stlaringiz bilan baham: |