0% found this document useful (0 votes)
45 views10 pages

FUNCTION

Functions allow code to be organized and reused. There are two types of functions: predefined functions defined in header files like printf(), and user-defined functions created by the user. Functions contain statements that are executed when the function is called. Functions can call other functions, with the calling function known as the caller and the called function known as the called function. Functions may take arguments as input and return values.

Uploaded by

Gaurang Vishnoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views10 pages

FUNCTION

Functions allow code to be organized and reused. There are two types of functions: predefined functions defined in header files like printf(), and user-defined functions created by the user. Functions contain statements that are executed when the function is called. Functions can call other functions, with the calling function known as the caller and the called function known as the called function. Functions may take arguments as input and return values.

Uploaded by

Gaurang Vishnoi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

“FUNCTION

IN
C- Programming”

PREPARED BY :- GAURANG VISHNOI


FUNCTION
What is function?
• A Function is a self contained block or a
separate block of a statements which are kept
together to perform a specific task in a related
manner.
• Every function must contain its definition as a
group of related statements to perform
specific task.
FUNCTION CALL
• Along with the function definition function call
is also important.
• A function has no use without its function call.
• A function can be called by any other function.
• A function which calls any other function is
called as caller function and the function
which is being called is known as called
function.
TYPES OF FUNCTION

FUNCTION
TYPE

PRE- USER
DEFINED DEFINED
PREDEFINED FUNCTION:-
• These are predefined function in c compiler
and their definitions are already available in
header file.
• Example- printf(), scanf(), pow().
• When ever we want to use these the function,
instead of writing the whole code we just
need to include the header file.
USER DEIFINE FUNCTION:-
• These are those function which are created by
user
User define function are of four type:-
1. No Argument No Return Type.
2. No Argument With Return Type.
3. With Argument No Return Type.
4. With Argument With Return Type.
WHAT ARE ARGUMENTS?
These are the data values which are passed from
the caller function to the called function.
TYPES OF ARGUMENTS:-
1. Actual Arguments.
2. Formal arguments
HOW FUNCTION WORKS
• Statement in the function are not executed
until the function is called
• A function can be called by any other function.
• A function which is calling any other function
is known as caller function.
• A function which is being called is known as
called function
ON OFF CH ++/CH -- VOL++/VOL--
{ { { {
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
---------; ---------; ---------; ---------;
--------; --------; --------; --------;
---------; ---------; ---------; ---------;
} } } }
ON OFF

CH+ VOL+

CH- VOL-
THANK YOU…!!

You might also like