Language basics: C language functions.

function

Functions encapsulate functionality into reusable modules (modularity).

The basic components of a function in a program are shown as follows:

  1. Return value type;
  2. Function name: Try to design a name that is related to the function.
  3. Passing parameters;
  4. Function body: The logical code that completes a function, enclosed in braces.

The sequential structure in a program, that is, the execution of each statement in the program from left to right and top to bottom.

The parameter passing process of a function is the process in which “arguments” assign values to “parameters”. “arguments” and “parameters” are independent of each other (changing the value of the parameter does not affect the argument).