SlideShare a Scribd company logo
1 of 7
C PROGRAMMING
BY MOHAMMED TAJUDDIN
C PROGRAMMING
• Functions can be invoked in two ways: Call by Value or Call by
Reference. These two ways are generally differentiated by the type of
values passed to them as parameters.
• The parameters passed to function are called actual parameters
whereas the parameters received by function are called formal
parameters.
C PROGRAMMING
• Call By Value: In this parameter passing method, values of actual
parameters are copied to function’s formal parameters and the two
types of parameters are stored in different memory locations. So any
changes made inside functions are not reflected in actual parameters
of the caller.
• Call by Reference: Both the actual and formal parameters refer to the
same locations, so any changes made inside the function are actually
reflected in actual parameters of the caller.
C PROGRAMMING
#include<stdio.h>
void swap(int,int);
void main(){
int a=10,b=20;
swap(a,b);}
printf(“%d%d”,a,b);}
void swap(int x,int y){
int t=x,x=y,y=t;
printf(“%d%d”,x,y);
}
C PROGRAMMING
#include<stdio.h>
void swap(int*,int*);
void main(){
int a=10,b=20;
printf(“%d%d”,a,b);
swap(&a,&b);}
void swap(int* x,int* y){
int t=*x,*x=*y,*y=t;
printf(“%d%d”,*x,*y);
}
C PROGRAMMING
Recursive function :
Function calling it self is called as recursive function.
Example :
#include<stdio.h>
int fact(int);
void main(){
int n,result;
printf(“enter number”);
scanf(“%d”,&n);
result=fact(n);
printf(“%d”,result);}
C PROGAMMING
int fact(int){
int res;
if(n==0){
res=1;}
else{
res=n*fact(n-1);}
return res;
}

More Related Content

Similar to FUNCTIONS1.pptx

User Defined Functions in C
User Defined Functions in CUser Defined Functions in C
User Defined Functions in CRAJ KUMAR
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxSangeetaBorde3
 
USER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfUSER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfBoomBoomers
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptxLGirija
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++LPU
 
Global variables, sorting static variables,function and arrays,
Global variables, sorting static variables,function and arrays,Global variables, sorting static variables,function and arrays,
Global variables, sorting static variables,function and arrays,Ahmad55ali
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...RSathyaPriyaCSEKIOT
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in CSyed Mustafa
 
358 33 powerpoint-slides_2-functions_chapter-2
358 33 powerpoint-slides_2-functions_chapter-2358 33 powerpoint-slides_2-functions_chapter-2
358 33 powerpoint-slides_2-functions_chapter-2sumitbardhan
 

Similar to FUNCTIONS1.pptx (20)

User Defined Functions in C
User Defined Functions in CUser Defined Functions in C
User Defined Functions in C
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptxCH.4FUNCTIONS IN C_FYBSC(CS).pptx
CH.4FUNCTIONS IN C_FYBSC(CS).pptx
 
Subprogramms
SubprogrammsSubprogramms
Subprogramms
 
PSPC-UNIT-4.pdf
PSPC-UNIT-4.pdfPSPC-UNIT-4.pdf
PSPC-UNIT-4.pdf
 
USER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfUSER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdf
 
Function in c
Function in cFunction in c
Function in c
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
Functions
Functions Functions
Functions
 
Presentation.pptx
Presentation.pptxPresentation.pptx
Presentation.pptx
 
16717 functions in C++
16717 functions in C++16717 functions in C++
16717 functions in C++
 
4th unit full
4th unit full4th unit full
4th unit full
 
Global variables, sorting static variables,function and arrays,
Global variables, sorting static variables,function and arrays,Global variables, sorting static variables,function and arrays,
Global variables, sorting static variables,function and arrays,
 
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
UNIT-1 notes(Data Types – Variables – Operations – Expressions and Statements...
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Pointers and call by value, reference, address in C
Pointers and call by value, reference, address in CPointers and call by value, reference, address in C
Pointers and call by value, reference, address in C
 
Lecture6
Lecture6Lecture6
Lecture6
 
Functions.pptx
Functions.pptxFunctions.pptx
Functions.pptx
 
358 33 powerpoint-slides_2-functions_chapter-2
358 33 powerpoint-slides_2-functions_chapter-2358 33 powerpoint-slides_2-functions_chapter-2
358 33 powerpoint-slides_2-functions_chapter-2
 
Unit 4
Unit 4Unit 4
Unit 4
 

More from MohammedtajuddinTaju (12)

EMBEDDED SYSTEM AUTOSAR.pdf
EMBEDDED SYSTEM AUTOSAR.pdfEMBEDDED SYSTEM AUTOSAR.pdf
EMBEDDED SYSTEM AUTOSAR.pdf
 
numbers_systems.pptx
numbers_systems.pptxnumbers_systems.pptx
numbers_systems.pptx
 
POINTERS.pptx
POINTERS.pptxPOINTERS.pptx
POINTERS.pptx
 
Nested and Infinite loops.pptx
Nested and Infinite loops.pptxNested and Infinite loops.pptx
Nested and Infinite loops.pptx
 
LOOPS IN C.pptx
LOOPS IN C.pptxLOOPS IN C.pptx
LOOPS IN C.pptx
 
FUNCTIONS.pptx
FUNCTIONS.pptxFUNCTIONS.pptx
FUNCTIONS.pptx
 
ARRAYS.pptx
ARRAYS.pptxARRAYS.pptx
ARRAYS.pptx
 
ARRAYS1.pptx
ARRAYS1.pptxARRAYS1.pptx
ARRAYS1.pptx
 
DMA.pptx
DMA.pptxDMA.pptx
DMA.pptx
 
INTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptxINTRODUCTION TO C LANGUAGE.pptx
INTRODUCTION TO C LANGUAGE.pptx
 
EMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptxEMBEDDED SYSTEMS INTRODUCTION.pptx
EMBEDDED SYSTEMS INTRODUCTION.pptx
 
C PROGRAMING.pptx
C PROGRAMING.pptxC PROGRAMING.pptx
C PROGRAMING.pptx
 

Recently uploaded

Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...Pooja Nehwal
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...amitlee9823
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRdollysharma2066
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...amitlee9823
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证tufbav
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证ehyxf
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证tufbav
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...drmarathore
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Call Girls in Nagpur High Profile
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Call Girls in Nagpur High Profile
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Bookingroncy bisnoi
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...Pooja Nehwal
 
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...Call Girls in Nagpur High Profile
 

Recently uploaded (20)

Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Pimple Saudagar Call Me 7737669865 Budget Friendly No Advance Booking
 
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night StandCall Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In RT Nagar ☎ 7737669865 🥵 Book Your One night Stand
 
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Ashok Nagar  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Ashok Nagar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...9004554577, Get Adorable Call Girls service. Book call girls & escort service...
9004554577, Get Adorable Call Girls service. Book call girls & escort service...
 
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
Vip Mumbai Call Girls Andheri East Call On 9920725232 With Body to body massa...
 
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcRCALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
CALL GIRLS IN Saket 83778-77756 | Escort Service In DELHI NcR
 
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Hauz Quazi  (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Hauz Quazi (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
Call Girls Banashankari Just Call 👗 7737669865 👗 Top Class Call Girl Service ...
 
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
怎样办理维多利亚大学毕业证(UVic毕业证书)成绩单留信认证
 
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
怎样办理圣芭芭拉分校毕业证(UCSB毕业证书)成绩单留信认证
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
怎样办理斯威本科技大学毕业证(SUT毕业证书)成绩单留信认证
 
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
Abort pregnancy in research centre+966_505195917 abortion pills in Kuwait cyt...
 
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
VVIP Pune Call Girls Warje (7001035870) Pune Escorts Nearby with Complete Sat...
 
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...Top Rated  Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
Top Rated Pune Call Girls Katraj ⟟ 6297143586 ⟟ Call Me For Genuine Sex Serv...
 
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...Top Rated  Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
Top Rated Pune Call Girls Shirwal ⟟ 6297143586 ⟟ Call Me For Genuine Sex Ser...
 
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Kothrud Call Me 7737669865 Budget Friendly No Advance Booking
 
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
9892124323 Pooja Nehwal Call Girls Services Call Girls service in Santacruz A...
 
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
(INDIRA) Call Girl Napur Call Now 8617697112 Napur Escorts 24x7
 
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...
↑Top celebrity ( Pune ) Nagerbazar Call Girls8250192130 unlimited shot and al...
 

FUNCTIONS1.pptx

  • 2. C PROGRAMMING • Functions can be invoked in two ways: Call by Value or Call by Reference. These two ways are generally differentiated by the type of values passed to them as parameters. • The parameters passed to function are called actual parameters whereas the parameters received by function are called formal parameters.
  • 3. C PROGRAMMING • Call By Value: In this parameter passing method, values of actual parameters are copied to function’s formal parameters and the two types of parameters are stored in different memory locations. So any changes made inside functions are not reflected in actual parameters of the caller. • Call by Reference: Both the actual and formal parameters refer to the same locations, so any changes made inside the function are actually reflected in actual parameters of the caller.
  • 4. C PROGRAMMING #include<stdio.h> void swap(int,int); void main(){ int a=10,b=20; swap(a,b);} printf(“%d%d”,a,b);} void swap(int x,int y){ int t=x,x=y,y=t; printf(“%d%d”,x,y); }
  • 5. C PROGRAMMING #include<stdio.h> void swap(int*,int*); void main(){ int a=10,b=20; printf(“%d%d”,a,b); swap(&a,&b);} void swap(int* x,int* y){ int t=*x,*x=*y,*y=t; printf(“%d%d”,*x,*y); }
  • 6. C PROGRAMMING Recursive function : Function calling it self is called as recursive function. Example : #include<stdio.h> int fact(int); void main(){ int n,result; printf(“enter number”); scanf(“%d”,&n); result=fact(n); printf(“%d”,result);}
  • 7. C PROGAMMING int fact(int){ int res; if(n==0){ res=1;} else{ res=n*fact(n-1);} return res; }