C Functions: Types of Function
C Functions: Types of Function
Suppose, you need to create a program to create a circle and color it. You
can create two functions to solve this problem:
Dividing a complex problem into smaller chunks makes our program easy
to understand and reuse.
Types of function
There are two types of function in C programming:
User-defined function
You can also create functions as per your need. Such functions created
by the user are known as user-defined functions.
int main()
{
... .. ...
... .. ...
functionName();
... .. ...
... .. ...
}
void functionName()
:
And, the compiler starts executing the codes inside functionName() .
The control of the program jumps back to the main() function once
code inside the function definition is executed.
:
Working of C Function
Video: C functions
:
#15 C Functions | C Programming for Beginners
Next Tutorial:
C User-defined (/c-programming/c-user-defined-
functions)
functions
Previous Tutorial:
(/c-programming/c-goto-statement)
C goto Statement
Share on:
(h"ps://www.facebook.com/sharer/sharer.php? (h"ps://twi"er.com/intent/tweet
u=h"ps://www.programiz.com/c-programming/c- text=Check%20this%20amazing
functions) programming/c-functions)
C Tutorial
C User-defined functions
s://programiz.pro/learn/master-c-programming?
source=nav- Search...
(/)
ng&utm_campaign=programiz&utm_medium=referral)
www.domain-name.com
(/c-programming/c-user-defined-functions)
C Tutorial
(/c-programming/library-function)
C Tutorial
(/c-programming/string-handling-functions)
C Tutorial
C Function Examples
(/c-programming/c-functions-examples)
: