Functions
Functions
Unit 2
Lecture-3
Unit-2 Syllabus
Control structures: Decision statements; if and switch statement; Loop
control statements: while, for and do while loops, jump statements,
break, continue, goto statements.
Arrays: Concepts, One dimensional array, declaration and initialization
of one dimensional arrays, two dimensional arrays, initialization and
accessing, multi dimensional arrays.
Functions: User defined and built-in Functions, storage classes,
Parameter passing in functions, call by value, Passing arrays to functions:
idea of call by reference, Recursion.
Strings: Arrays of characters, variable length character strings, inputting
character strings, character library functions, string handling functions.
In this Lecture
Declaration
Defination
Calling
Declaration
of Function
return_type
name_of_the_function
(parameter_1,
parameter_2);
Defining a
Function
return_type function_name
(para1_type para1_name,
para2_type para2_name)
{
// body of the function
}
Calling a
Function
Write a program to give sum
of two numbers using
function
Built-in Vs User Defined Functions
Output
Call By Reference
Output
Call By Value VS Call By Reference