Definition: Function is a self-contained block of statement that perform a coherent tasks. using function we can divide a large program into the basic building blocks.
There are many functions we are used already such as- printf(), scanf(), pow(), sqrt() and most important function is main().
There are two types of function's.
There are many functions we are used already such as- printf(), scanf(), pow(), sqrt() and most important function is main().
Types of function's:
There are two types of function's.
- Standard library functions.
- User-defined functions.
1. Standard library functions: Functions which already have a definition in header files(like stdio.h) this type of functions are called standard library functions. Which are printf(), scanf(), puts(), gets() etc.
2. User defined functions: The functions that we create in a program this type of functions are called as user defined functions.
In this tutorial we will learn how works user defined functions.
Syntax:
Above program shows the following output:
No comments:
Post a Comment
If you have any doubts, please discuss here...👇