One of the prime factors behind using function is that code duplication in program is avoided and memory
space is saved. When a function is defined and invoked, one set of instruction is created in the memory of the
system. At each call, the control passes to the subroutine at a specified address in the memory. The CPU stores
the memory address of instruction following the function calls into the stack and also pushes the arguments in
the stack area. The compiler runs the function, stores the return val ues in a memory location or register and
when execution completes, the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.