SlideShare une entreprise Scribd logo
1  sur  15
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

Contenu connexe

En vedette

Pharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory PartnersPharmalinks Global Regulatory Partners
Pharmalinks Global Regulatory Partners
temreez
 
构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析构建私有云计算平台的Eucalyptus架构分析
构建私有云计算平台的Eucalyptus架构分析
liangxiao0315
 
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究基于云计算平台的移动Iptv系统设计及负载均衡技术研究
基于云计算平台的移动Iptv系统设计及负载均衡技术研究
liangxiao0315
 
腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍腾讯大讲堂25 企业级搜索托管平台介绍
腾讯大讲堂25 企业级搜索托管平台介绍
George Ang
 
基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)基于Eucalyptus的教育知识服务体系模型研究(1)
基于Eucalyptus的教育知识服务体系模型研究(1)
liangxiao0315
 
Zaridah lecture2
Zaridah lecture2Zaridah lecture2
Zaridah lecture2
Aziz Sahat
 

En vedette (9)

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

Similaire à Function creation and function call in c copy

object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
urvashipundir04
 

Similaire à Function creation and function call in c copy (20)

unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
5. Functions in C.pdf
5. Functions in C.pdf5. Functions in C.pdf
5. Functions in C.pdf
 
4th unit full
4th unit full4th unit full
4th unit full
 
Programming Fundamentals Functions in C and types
Programming Fundamentals  Functions in C  and typesProgramming Fundamentals  Functions in C  and types
Programming Fundamentals Functions in C and types
 
U19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).pptU19CS101 - PPS Unit 4 PPT (1).ppt
U19CS101 - PPS Unit 4 PPT (1).ppt
 
EST 102 Programming in C-MODULE 4
EST 102 Programming in C-MODULE 4EST 102 Programming in C-MODULE 4
EST 102 Programming in C-MODULE 4
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Functions
FunctionsFunctions
Functions
 
Anagha
AnaghaAnagha
Anagha
 
Unit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptxUnit 2 CMath behind coding.pptx
Unit 2 CMath behind coding.pptx
 
Functions in c
Functions in cFunctions in c
Functions in c
 
Programming in c (importance of c)
Programming in c (importance of c)Programming in c (importance of c)
Programming in c (importance of c)
 
cp Module4(1)
cp Module4(1)cp Module4(1)
cp Module4(1)
 
Functions
FunctionsFunctions
Functions
 
object oriented programming part inheritance.pptx
object oriented programming part inheritance.pptxobject oriented programming part inheritance.pptx
object oriented programming part inheritance.pptx
 
Functions
FunctionsFunctions
Functions
 
Function C programming
Function C programmingFunction C programming
Function C programming
 
Fundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptxFundamentals of Data Structures Unit 1.pptx
Fundamentals of Data Structures Unit 1.pptx
 
Scope of variables
Scope of variablesScope of variables
Scope of variables
 

Plus de baabtra.com - No. 1 supplier of quality freshers

Plus de baabtra.com - No. 1 supplier of quality freshers (20)

Agile methodology and scrum development
Agile methodology and scrum developmentAgile methodology and scrum development
Agile methodology and scrum development
 
Best coding practices
Best coding practicesBest coding practices
Best coding practices
 
Core java - baabtra
Core java - baabtraCore java - baabtra
Core java - baabtra
 
Acquiring new skills what you should know
Acquiring new skills   what you should knowAcquiring new skills   what you should know
Acquiring new skills what you should know
 
Baabtra.com programming at school
Baabtra.com programming at schoolBaabtra.com programming at school
Baabtra.com programming at school
 
99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love 99LMS for Enterprises - LMS that you will love
99LMS for Enterprises - LMS that you will love
 
Php sessions & cookies
Php sessions & cookiesPhp sessions & cookies
Php sessions & cookies
 
Php database connectivity
Php database connectivityPhp database connectivity
Php database connectivity
 
Chapter 6 database normalisation
Chapter 6  database normalisationChapter 6  database normalisation
Chapter 6 database normalisation
 
Chapter 5 transactions and dcl statements
Chapter 5  transactions and dcl statementsChapter 5  transactions and dcl statements
Chapter 5 transactions and dcl statements
 
Chapter 4 functions, views, indexing
Chapter 4  functions, views, indexingChapter 4  functions, views, indexing
Chapter 4 functions, views, indexing
 
Chapter 3 stored procedures
Chapter 3 stored proceduresChapter 3 stored procedures
Chapter 3 stored procedures
 
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
Chapter 2  grouping,scalar and aggergate functions,joins   inner join,outer joinChapter 2  grouping,scalar and aggergate functions,joins   inner join,outer join
Chapter 2 grouping,scalar and aggergate functions,joins inner join,outer join
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Microsoft holo lens
Microsoft holo lensMicrosoft holo lens
Microsoft holo lens
 
Blue brain
Blue brainBlue brain
Blue brain
 
5g
5g5g
5g
 
Aptitude skills baabtra
Aptitude skills baabtraAptitude skills baabtra
Aptitude skills baabtra
 
Gd baabtra
Gd baabtraGd baabtra
Gd baabtra
 

Dernier

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
ssuserdda66b
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Dernier (20)

How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdfVishram Singh - Textbook of Anatomy  Upper Limb and Thorax.. Volume 1 (1).pdf
Vishram Singh - Textbook of Anatomy Upper Limb and Thorax.. Volume 1 (1).pdf
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 

Function creation and function call in c copy

  • 1.
  • 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