SlideShare a Scribd company logo
Function creation and function call in c   copy
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
Typing Speed
Week

Target Achieved

1

40

25

2

40

28

3
Jobs Applied
Week
1
2
3

Company

Designation

Applied Date

Current Status
Function creation &
Function call in c
Muhammed Noufal V T
muhammednoufalvt@gmail.c
om
www.facebook.com/vtnoufa
lvt
twitter.com/noufalurnappy
in.linkedin.com/pub/muham
med-noufal
9744003056
Functions in c
• Types of functions
- Built in functions (library
functions)
- User defined functions
• Advantagas
-Decrease the length of the
program
-Easy to manipulate
Built in functions
(library functions)

• Sub programs that is already defined in c
language
compiler
• Syntax to call a function
function name();
• Examples :scanf();
printf();
clrscr();
strcpy();
Program using Built in
functions (library functions)
•

#include<stdio.h>
#include<conio.h>
#include<string.h>
void main()
{
char s1[20];
char s2[20];
int l;
clrscr();
printf(“Enter the two stringsn”);
scanf(“%s%s”,s1,s2);
l=strlen(s1);
printf(“length of the string is %d”,&l);
strcat(s1,s2);
printf(“combined string=%s”,s1);
getch();
}
User defined functions
• Functions defined by user
• Advantagas
-Reusability
-Easy to manipulate
• Syntax to declare a user defined function
data type function name();
• Syntax to define a user defined function
data type function name()
{
function body;
}
Program using user
defined functions
•

#include<stdio.h>
#include<stdio.h>
void main()
{
clrscr();
add();
getch();
}
int add()
{
int a,b,c;
printf(“Enter two numbers to addn”);
scanf(“%d%d”,&a,&b);
c=a+b;
printf(“Addition of the two numbers=%d”,&c)
}
user define functions
• Default function
-Function which doesn’t support parameter
variables
• Parameter function
-Function which contains parameter variables
Syntax
data type function name(data type variable
1,… variable n)
• Return statement
-The statement which return values from
functions to calling sections
• Methods of passing argument values to
parameterized function
Program using pass by value
method
#include<stdio.h>
#include<conio.h>
int add(int,int);
void main()
{
int a,b,c;
clrscr();
printf(“Enter two numbersn”);
scanf(“%d%d”,&a,&b);
c=add(a,b);
printf(“Addition=%d”,&c);
getch();
}

int add(int n, int m)
{
int s;
s=n+m;
return(s);
}
Program using pass by
referanceint add(int *x,int *y)
method
#include<stdio.h>
#include<conio.h>
int add(int *x,int *y)
void main()
{
int a,b,c,*p1,*p2;
clrscr();
printf(“Enter two numbers”);
scanf(“%d%d”,&a,&b);
p1=&a;
p2=&b;
c=add(p1,p2);
printf(“addition=%d”,c);
getch();
}

{
int *z;
*z=*x+*y;
return(*z);
}
If this presentation helped you, please visit our
page facebook.com/baabtra and like it.

Thanks in advance.
www.baabtra.com | www.massbaab.com |www.baabte.com
Contact Us
Emarald Mall (Big Bazar Building)
Mavoor Road, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

Start up Village
Eranakulam,
Kerala, India.
Email: info@baabtra.com

NC Complex, Near Bus Stand
Mukkam, Kozhikode,
Kerala, India.
Ph: + 91 – 495 40 25 550

More Related Content

PDF
bpmn. Quadratic equation
DOCX
Exp 3-2 d422 (1)
PDF
Epc test practical
PPTX
Global variables, sorting static variables,function and arrays,
PPTX
Functions in c++
bpmn. Quadratic equation
Exp 3-2 d422 (1)
Epc test practical
Global variables, sorting static variables,function and arrays,
Functions in c++

Viewers also liked (9)

PPT
Pharmalinks Global Regulatory Partners
PDF
构建私有云计算平台的Eucalyptus架构分析
PDF
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
PPT
腾讯大讲堂25 企业级搜索托管平台介绍
PDF
基于Eucalyptus的教育知识服务体系模型研究(1)
PDF
Zaridah lecture2
PDF
Hadoop开发者入门专刊
PPTX
DOC
Ds program-print
Pharmalinks Global Regulatory Partners
构建私有云计算平台的Eucalyptus架构分析
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
腾讯大讲堂25 企业级搜索托管平台介绍
基于Eucalyptus的教育知识服务体系模型研究(1)
Zaridah lecture2
Hadoop开发者入门专刊
Ds program-print
Ad

Similar to Function creation and function call in c copy (20)

PPTX
unit_2.pptx
PPTX
unit_2 (1).pptx
PDF
5. Functions in C.pdf
PDF
4th unit full
PDF
Programming Fundamentals Functions in C and types
PPTX
Functions and Header files ver very useful
PPTX
Funtions of c programming. the functions of c helps to clarify all the tops
PPT
U19CS101 - PPS Unit 4 PPT (1).ppt
PPTX
EST 102 Programming in C-MODULE 4
PPTX
Presentation on Function in C Programming
PPTX
PPTX
PPTX
C functions by ranjan call by value and reference.pptx
PPTX
Unit 2 CMath behind coding.pptx
PPTX
C++ Intro C++ Intro C++ Intro C++ Intro C++ Intro
PPTX
Functions in c
PPT
Data structure and problem solving ch02.ppt
PDF
Functions in Pythons UDF and Functions Concepts
PPTX
Programming in c (importance of c)
PDF
cp Module4(1)
unit_2.pptx
unit_2 (1).pptx
5. Functions in C.pdf
4th unit full
Programming Fundamentals Functions in C and types
Functions and Header files ver very useful
Funtions of c programming. the functions of c helps to clarify all the tops
U19CS101 - PPS Unit 4 PPT (1).ppt
EST 102 Programming in C-MODULE 4
Presentation on Function in C Programming
C functions by ranjan call by value and reference.pptx
Unit 2 CMath behind coding.pptx
C++ Intro C++ Intro C++ Intro C++ Intro C++ Intro
Functions in c
Data structure and problem solving ch02.ppt
Functions in Pythons UDF and Functions Concepts
Programming in c (importance of c)
cp Module4(1)
Ad

More from baabtra.com - No. 1 supplier of quality freshers (20)

PPTX
Agile methodology and scrum development
PDF
Acquiring new skills what you should know
PDF
Baabtra.com programming at school
PDF
99LMS for Enterprises - LMS that you will love
PPTX
Chapter 6 database normalisation
PPTX
Chapter 5 transactions and dcl statements
PPTX
Chapter 4 functions, views, indexing
PPTX
PPTX
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
PPTX
Chapter 1 introduction to sql server
PPTX
Chapter 1 introduction to sql server
Agile methodology and scrum development
Acquiring new skills what you should know
Baabtra.com programming at school
99LMS for Enterprises - LMS that you will love
Chapter 6 database normalisation
Chapter 5 transactions and dcl statements
Chapter 4 functions, views, indexing
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 1 introduction to sql server
Chapter 1 introduction to sql server

Recently uploaded (20)

PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PPTX
Week 4 Term 3 Study Techniques revisited.pptx
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
Business Ethics Teaching Materials for college
PDF
VCE English Exam - Section C Student Revision Booklet
PPTX
Institutional Correction lecture only . . .
PPTX
PPH.pptx obstetrics and gynecology in nursing
PPTX
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
PDF
Classroom Observation Tools for Teachers
PDF
01-Introduction-to-Information-Management.pdf
PDF
Pre independence Education in Inndia.pdf
PDF
Complications of Minimal Access Surgery at WLH
PDF
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
PPTX
Cell Structure & Organelles in detailed.
PDF
Supply Chain Operations Speaking Notes -ICLT Program
PPTX
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
PDF
RMMM.pdf make it easy to upload and study
PPTX
Pharma ospi slides which help in ospi learning
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
2.FourierTransform-ShortQuestionswithAnswers.pdf
Week 4 Term 3 Study Techniques revisited.pptx
Abdominal Access Techniques with Prof. Dr. R K Mishra
Business Ethics Teaching Materials for college
VCE English Exam - Section C Student Revision Booklet
Institutional Correction lecture only . . .
PPH.pptx obstetrics and gynecology in nursing
BOWEL ELIMINATION FACTORS AFFECTING AND TYPES
Classroom Observation Tools for Teachers
01-Introduction-to-Information-Management.pdf
Pre independence Education in Inndia.pdf
Complications of Minimal Access Surgery at WLH
Physiotherapy_for_Respiratory_and_Cardiac_Problems WEBBER.pdf
Cell Structure & Organelles in detailed.
Supply Chain Operations Speaking Notes -ICLT Program
IMMUNITY IMMUNITY refers to protection against infection, and the immune syst...
RMMM.pdf make it easy to upload and study
Pharma ospi slides which help in ospi learning
FourierSeries-QuestionsWithAnswers(Part-A).pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx

Function creation and function call in c copy

  • 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
  • 5. Function creation & Function call in c Muhammed Noufal V T muhammednoufalvt@gmail.c om www.facebook.com/vtnoufa lvt twitter.com/noufalurnappy in.linkedin.com/pub/muham med-noufal 9744003056
  • 6. Functions in c • Types of functions - Built in functions (library functions) - User defined functions • Advantagas -Decrease the length of the program -Easy to manipulate
  • 7. Built in functions (library functions) • Sub programs that is already defined in c language compiler • Syntax to call a function function name(); • Examples :scanf(); printf(); clrscr(); strcpy();
  • 8. Program using Built in functions (library functions) • #include<stdio.h> #include<conio.h> #include<string.h> void main() { char s1[20]; char s2[20]; int l; clrscr(); printf(“Enter the two stringsn”); scanf(“%s%s”,s1,s2); l=strlen(s1); printf(“length of the string is %d”,&l); strcat(s1,s2); printf(“combined string=%s”,s1); getch(); }
  • 9. User defined functions • Functions defined by user • Advantagas -Reusability -Easy to manipulate • Syntax to declare a user defined function data type function name(); • Syntax to define a user defined function data type function name() { function body; }
  • 10. Program using user defined functions • #include<stdio.h> #include<stdio.h> void main() { clrscr(); add(); getch(); } int add() { int a,b,c; printf(“Enter two numbers to addn”); scanf(“%d%d”,&a,&b); c=a+b; printf(“Addition of the two numbers=%d”,&c) }
  • 11. user define functions • Default function -Function which doesn’t support parameter variables • Parameter function -Function which contains parameter variables Syntax data type function name(data type variable 1,… variable n) • Return statement -The statement which return values from functions to calling sections • Methods of passing argument values to parameterized function
  • 12. Program using pass by value method #include<stdio.h> #include<conio.h> int add(int,int); void main() { int a,b,c; clrscr(); printf(“Enter two numbersn”); scanf(“%d%d”,&a,&b); c=add(a,b); printf(“Addition=%d”,&c); getch(); } int add(int n, int m) { int s; s=n+m; return(s); }
  • 13. Program using pass by referanceint add(int *x,int *y) method #include<stdio.h> #include<conio.h> int add(int *x,int *y) void main() { int a,b,c,*p1,*p2; clrscr(); printf(“Enter two numbers”); scanf(“%d%d”,&a,&b); p1=&a; p2=&b; c=add(p1,p2); printf(“addition=%d”,c); getch(); } { int *z; *z=*x+*y; return(*z); }
  • 14. If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance. www.baabtra.com | www.massbaab.com |www.baabte.com
  • 15. Contact Us Emarald Mall (Big Bazar Building) Mavoor Road, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550 Start up Village Eranakulam, Kerala, India. Email: info@baabtra.com NC Complex, Near Bus Stand Mukkam, Kozhikode, Kerala, India. Ph: + 91 – 495 40 25 550