Welcome to the
presentation of
Programming
Fundamental
Presented by
Muhammad Bilal
Muzammil Bashir
Abuzar Mumtaz
Function
Function is a named block of code
that perform some action.
Statement written in function
executed when it is call by its name.
Each function has its unique name.
Function
Return-type:-
 It indicates the type of value that will returned by
function.
 For example : int is used as a return type if function return
integer value.
 If function returns no value then the keyword void is used.
Function-name:-
 It indicates the name of function.
Parameters:-
 Parameters are the values that are provided to function
when function is called.
Function Types
 There are two types of function :
1. Built-in function
2. User-define function
Function types
Build in functions that available as a
part of language. Like getch(); etc.
User define function that written by
programmer.
Function consist of two parts :
1. Function body.
2. Function header.
Function call
Function advantages
There are many advantages
to use functions:
Easy to code.
Easy to maintain and
debug.
Reusability.
Less programming time.
Function
Function
call by three
ways:
By name.
By
reference.
By value.
Function definition
Set of statements that explain that
what function does is called
function definition.
It can be written in following
places:
Before main function.
After main function.
In separate file.
Function Prototype
Function prototype also called
function header.
The first line of function definition is
called function header.
Basic syntax is:
Return-type function-name
(parameters)
Function prototype
Basic syntax
Function call
 Statement that
active a function
is called function
call.
 When function is
called control
move to function
that is called and
return back to
calling function.
Function
Basic syntax
Local Function
 Local functions are a form
of information hiding and
they are useful for dividing
procedural tasks into
subtasks.
 It is also called nested
function.
Global Function
Global function refers to a set of
shared information within the
system include tasks like data
recovery and data transfer etc.
They have global scope.
Functions
Thanks …

presentation of pf programming fundamentals.pptx

  • 1.
    Welcome to the presentationof Programming Fundamental Presented by Muhammad Bilal Muzammil Bashir Abuzar Mumtaz
  • 2.
    Function Function is anamed block of code that perform some action. Statement written in function executed when it is call by its name. Each function has its unique name.
  • 3.
  • 4.
    Return-type:-  It indicatesthe type of value that will returned by function.  For example : int is used as a return type if function return integer value.  If function returns no value then the keyword void is used. Function-name:-  It indicates the name of function. Parameters:-  Parameters are the values that are provided to function when function is called.
  • 5.
    Function Types  Thereare two types of function : 1. Built-in function 2. User-define function
  • 6.
    Function types Build infunctions that available as a part of language. Like getch(); etc. User define function that written by programmer. Function consist of two parts : 1. Function body. 2. Function header.
  • 7.
  • 8.
    Function advantages There aremany advantages to use functions: Easy to code. Easy to maintain and debug. Reusability. Less programming time.
  • 9.
    Function Function call by three ways: Byname. By reference. By value.
  • 10.
    Function definition Set ofstatements that explain that what function does is called function definition. It can be written in following places: Before main function. After main function. In separate file.
  • 11.
    Function Prototype Function prototypealso called function header. The first line of function definition is called function header. Basic syntax is: Return-type function-name (parameters)
  • 12.
  • 13.
    Function call  Statementthat active a function is called function call.  When function is called control move to function that is called and return back to calling function.
  • 14.
  • 15.
    Local Function  Localfunctions are a form of information hiding and they are useful for dividing procedural tasks into subtasks.  It is also called nested function.
  • 16.
    Global Function Global functionrefers to a set of shared information within the system include tasks like data recovery and data transfer etc. They have global scope.
  • 17.
  • 18.