Functions
©LPU CSE202 C++ Programming
, What is function????
• Function is a self contained block of
statements that perform a coherent task of
some kind.
• Every C++ program can be a thought of the
collection of functions.
• main( ) is also a function.
©LPU CSE202 C++ Programming
, Types of Functions.
• Library functions
– These are the in- -built functions of ‘C++ ’library.
– These are already defined in header files.
– e.g. Cout<<; is a function which is used to print at
output. It is defined in ‘iostream.h ’ file .
• User defined functions.
– Programmer can create their own function in C++
to perform specific task
©LPU CSE202 C++ Programming
, Why use function?
©LPU CSE202 C++ Programming
©LPU CSE202 C++ Programming
, What is function????
• Function is a self contained block of
statements that perform a coherent task of
some kind.
• Every C++ program can be a thought of the
collection of functions.
• main( ) is also a function.
©LPU CSE202 C++ Programming
, Types of Functions.
• Library functions
– These are the in- -built functions of ‘C++ ’library.
– These are already defined in header files.
– e.g. Cout<<; is a function which is used to print at
output. It is defined in ‘iostream.h ’ file .
• User defined functions.
– Programmer can create their own function in C++
to perform specific task
©LPU CSE202 C++ Programming
, Why use function?
©LPU CSE202 C++ Programming