C – Functions and Calling

main() function:

  • main() function must be defined in every C program
  • C program execution starts from main() function.
  • main() function automatically invoke by Operating system.

User function:

  • Defining other functions along with main() function.
  • We must declare(prototype) of user function.

Calling the function:

  • Only main() function invokes automatically by OS
  • All other functions in C program must be called manually.
  • User function logic executes only when we call.

The following program clearly explains how the control back to calling function after execution of called function.

Calling Function: the function from which other function called.

Called Function: the function which is called from other function.

We can invoke the function any number of times once it has defined.

  • We can define any number of functions in C-Program.
  • We can define the functions in any order.
  • We invoke the defined functions in any order.

Execution flow of HelloWorld program briefly:

  • Every C Program execution starts with main() function.
  • OS invokes main() function automatically.
  • #include is a pre-processor directive which is used to connect programs in C application.
Scroll to Top