CSE 101
(Unit-2)
Function
Dr.S.Priya/AP-III/ICT/SOC
SASTRA University
Progress Through
Progress Through Quality
Quality Education
Education
, Function Overview
• Program Segment – carry specific task
• Set of statements to perform a task
• Every program at least one function
– main( )
• Why Function is needed?
– Larger program
ü Readability, debugging and testing
ü Divided into smaller parts
ü Sub part => function
– Code reusability
ü Repeated statements
– Reduce the code length
– Easy understanding
21-Oct-24 Progress Through Quality Education
, • Two different functions category
– Predefined functions
ü Already predefined
ü scanf(),printf(),sqrt(),pow(),etc
– User defined Function
ü Define by the user
21-Oct-24 Progress Through Quality Education
(Unit-2)
Function
Dr.S.Priya/AP-III/ICT/SOC
SASTRA University
Progress Through
Progress Through Quality
Quality Education
Education
, Function Overview
• Program Segment – carry specific task
• Set of statements to perform a task
• Every program at least one function
– main( )
• Why Function is needed?
– Larger program
ü Readability, debugging and testing
ü Divided into smaller parts
ü Sub part => function
– Code reusability
ü Repeated statements
– Reduce the code length
– Easy understanding
21-Oct-24 Progress Through Quality Education
, • Two different functions category
– Predefined functions
ü Already predefined
ü scanf(),printf(),sqrt(),pow(),etc
– User defined Function
ü Define by the user
21-Oct-24 Progress Through Quality Education