Building AI-Driven Apps Using Semantic Kernel.pptx
Functions and return type
2. Disclaimer: This presentation is prepared by trainees of
baabtra as a part of mentoring program. This is not official
document of baabtra –Mentoring Partner
Baabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .
Ltd
4. • one of the strengths of c language is c
functions,they are easy to define and use
• C function can be classified in to two
catagories
• 1 library function :printf and scanf
• 2 user defind function: main
5. Need for user defined function
• Main is specially recoganized function in
c,every program must have a main function to
indicate where the program has to be
execution
• If a program condain only main function
number of problem,testing and maintaining
become difficult
6. • Program is divided in to functional part
,which is independently coded and later
combined in to a single unit
• This independently coded programs are
called sub programs are referred as
function
8. Definition of function
• function name
• Function type
• List of parameters
• Local variable declaration
• Function statement
• Return statement
9. Function_type function _name(parameter list)
{
local variable declaration;
executable statement1;
executable statement2;
…………………………………..
return statement;
}
10. Function header
• Type specifies type of value that expected to
return eg:int,float
• Void:function not return anything
• name is valid c identifier
• Same rule for other variable name in c
11. Formal parameter list
• Input data to the function and carry out the
specified task
• Also used to send values to the calling
programs
• also known as arguments
12. Function body
• Float mul ( float flt_ x ,float flt_ y)
{
float result; /*local variable*/
result=flt_x*flt_y; /*compute the
mul*/
return (result);
}
17. • Declaration placed two places in program
1. Above all the function including main
2. Inside a function definition
18. Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550
Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com