3.1 INTRODUCTION TO FUNCTIONS
Functions are small piece of code performing a particular task. They help in modularizing our program. A function is a small independent unit of a program. Any program contains one or more function. The function (with name) main() is compulsory. The execution of the program normally starts with function main().
The main function during execution can call other functions. Invoking a function is referred to as calling that function. At the end, function returns the control back to the point from where it was called. Hence, typically return statement is the last statement of a function.
Functions can return any non-aggregate data type, including reference or void. From aggregate data types, functions can return structures ...
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.
Read now
Unlock full access