SlideShare a Scribd company logo
1 of 11
Mubashir Farooq
1405(BScs)
GOVT Municipal Degree College FSD
Definition
A Function is a self-contained block of statement
that perform a task of some kind.
OR
Function is a set of instruction to carryout a
particular task.
Function after its execution returns a single value
when we call it in our program.
Functions in C
1.Built-in-Functions
• The built-in-function are
also called library function
or Standard Function. These
functions are
provided by programmer.
• printf(); and scanf(); are
Some common types of
built-in-Functions.
2.User-Defined Fun.
• Defined by user at the
time of writing the
program. User set these
program for her own
uses.
• Add(); Max(); etc are
some kinds of user-
defined functions.
Functions in C
Need of functions
• Enabling code reuse
• Better readability
• Improved debugging and testing
• Improved maintainability
• Reduce lines of code
Functions in C
Steps of User-Defined-F.
There are three steps of working with user
Defined functions:
1. Function Declaration, also known as function
prototype
2. Function Dentition means body of function.
3. Function use, also known as function call.
Functions in C
Programs.
• Simple program by Function :-
#include<stdio.h>
void massage();/*Function prototype declaration*/
void main()
{
void massage();/*function call*/
}
void massage()/*function definition*/
{
printf(“This is a simple program");
}
start
Function call
Void massag
Output
end
Out put :-
This is simple program
To find area and circumference of
circle.
#include<stdio.h>
#define PI 3.14159
float carea(float);
float ccir(float);
void main()
{ float radius;
printf("Enter floater Radius:");
scanf("%f",&radius);
carea(radius);
ccir(radius);
getch();
} float carea(float radius)
{ float area;
area=PI*radius*radius;
printf("Area= %fn",area);}
float ccir(float radius)
{ float ccir;
cir=2*PI*radius;
printf("Circumference= %f",cir);}
• Flo.
Programs.
start
Input radius
Function call
Float carea,crim
area=PI*radius*radius
cir=2*PI* radius
Output
Area,Cri
end
Enter floater Radius _5.0
Area=78.53975
Circumference=31.4159
To find area and circumference of
cube.
#include<stdio.h>
#define PI 3.14159
float carea(float);
float ccir(float);
void main()
{ float radius;
printf("Enter floater Radius:");
scanf("%f",&radius);
carea(radius);
ccir(radius);
getch();
} float carea(float radius)
{ float area;
area=4*PI*radius*radius;
printf("Area= %fn",area);}
float ccir(float radius)
{ float ccir;
cir=4/3*PI*radius*radius*radius*;
printf("Circumferernce= %f",cir);}
Programs. start
Input radius
Function call
Float carea,crim
area=4*PI*radius*radius
cir=4/3*PI* radius* radius*radius
Output
Area,Cir
end
Enter floater Radius _5.0
Area=1570.795
Circumference=523.59833335
To Exchange Values of 2 variables.
include<stdio.h>
void swap(int *x, int *y);
void main() {
int x, y;
printf("nEnter First number : ");
scanf("%d", &x);
printf("nEnter Second number : ");
scanf("%d", &y);
printf("nBefore Swaping x = %d and y = %d", x, y);
swap(&x, &y);
printf("nAfter Swaping x = %d and y = %d", x, y);
getch();}
void swap(int *x, int *y) {
int temp;
temp = *x;
*x = *y;
*y = temp;}
Programs. start
Input x,y
Output
Values of x and y
end
Function call
Void swap
Temp=*x
*x=*y
Y=*temp
Enter First number_4
Enter Second number_8
Before Swaping x=4 and y=8
After Swaping x=8 and y=4
If No
Question.???
by MF Malik

More Related Content

What's hot

C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control StructureSokngim Sa
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and StringTasnima Hamid
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmigAppili Vamsi Krishna
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c languagetanmaymodi4
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in clavanya marichamy
 
Storage class in c
Storage class in cStorage class in c
Storage class in ckash95
 
String in c programming
String in c programmingString in c programming
String in c programmingDevan Thakur
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C ProgrammingShuvongkor Barman
 
Command line arguments
Command line argumentsCommand line arguments
Command line argumentsAshok Raj
 

What's hot (20)

C Programming: Control Structure
C Programming: Control StructureC Programming: Control Structure
C Programming: Control Structure
 
Character Array and String
Character Array and StringCharacter Array and String
Character Array and String
 
Strings
StringsStrings
Strings
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Functions in c++
Functions in c++Functions in c++
Functions in c++
 
Function in c
Function in cFunction in c
Function in c
 
User defined functions in C programmig
User defined functions in C programmigUser defined functions in C programmig
User defined functions in C programmig
 
Functions in C
Functions in CFunctions in C
Functions in C
 
Operators and expressions in c language
Operators and expressions in c languageOperators and expressions in c language
Operators and expressions in c language
 
Arrays in c
Arrays in cArrays in c
Arrays in c
 
Break and continue
Break and continueBreak and continue
Break and continue
 
Dynamic memory allocation in c
Dynamic memory allocation in cDynamic memory allocation in c
Dynamic memory allocation in c
 
Storage class in c
Storage class in cStorage class in c
Storage class in c
 
String in c programming
String in c programmingString in c programming
String in c programming
 
Unit 3. Input and Output
Unit 3. Input and OutputUnit 3. Input and Output
Unit 3. Input and Output
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Parameter passing to_functions_in_c
Parameter passing to_functions_in_cParameter passing to_functions_in_c
Parameter passing to_functions_in_c
 
Command line arguments
Command line argumentsCommand line arguments
Command line arguments
 
Control statements in c
Control statements in cControl statements in c
Control statements in c
 

Similar to Functions in C

5. Functions in C.pdf
5. Functions in C.pdf5. Functions in C.pdf
5. Functions in C.pdfsantosh147365
 
Lecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptxLecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptxKhurramKhan173
 
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 typesimtiazalijoono
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...kushwahashivam413
 
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).pptManivannan837728
 
Functions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxFunctions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxvanshhans21102005
 
USER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfUSER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfBoomBoomers
 
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
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg PatelTechNGyan
 

Similar to Functions in C (20)

5. Functions in C.pdf
5. Functions in C.pdf5. Functions in C.pdf
5. Functions in C.pdf
 
FUNCTIONS.pptx
FUNCTIONS.pptxFUNCTIONS.pptx
FUNCTIONS.pptx
 
unit_2 (1).pptx
unit_2 (1).pptxunit_2 (1).pptx
unit_2 (1).pptx
 
Function in c program
Function in c programFunction in c program
Function in c program
 
Lecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptxLecture 1_Functions in C.pptx
Lecture 1_Functions in C.pptx
 
C structure
C structureC structure
C structure
 
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
 
unit_2.pptx
unit_2.pptxunit_2.pptx
unit_2.pptx
 
function in in thi pdf you will learn what is fu...
function in  in thi pdf you will learn   what                           is fu...function in  in thi pdf you will learn   what                           is fu...
function in in thi pdf you will learn what is fu...
 
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
 
Functions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxFunctions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptx
 
visiblity and scope.pptx
visiblity and scope.pptxvisiblity and scope.pptx
visiblity and scope.pptx
 
Functions
FunctionsFunctions
Functions
 
USER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdfUSER DEFINED FUNCTIONS IN C.pdf
USER DEFINED FUNCTIONS IN C.pdf
 
Structure of a C program
Structure of a C programStructure of a C program
Structure of a C program
 
CP Handout#2
CP Handout#2CP Handout#2
CP Handout#2
 
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
 
Unit 3 (1)
Unit 3 (1)Unit 3 (1)
Unit 3 (1)
 
Basics of c Nisarg Patel
Basics of c Nisarg PatelBasics of c Nisarg Patel
Basics of c Nisarg Patel
 
Functions struct&union
Functions struct&unionFunctions struct&union
Functions struct&union
 

Recently uploaded

SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...Bert Jan Schrijver
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingShane Coughlan
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesKrzysztofKkol1
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfRTS corp
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogueitservices996
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxRTS corp
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorTier1 app
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...OnePlan Solutions
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITmanoharjgpsolutions
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?Alexandre Beguel
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfmaor17
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingShane Coughlan
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 

Recently uploaded (20)

SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
JavaLand 2024 - Going serverless with Quarkus GraalVM native images and AWS L...
 
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full RecordingOpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
OpenChain AI Study Group - Europe and Asia Recap - 2024-04-11 - Full Recording
 
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilitiesAmazon Bedrock in Action - presentation of the Bedrock's capabilities
Amazon Bedrock in Action - presentation of the Bedrock's capabilities
 
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdfEnhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
Enhancing Supply Chain Visibility with Cargo Cloud Solutions.pdf
 
Ronisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited CatalogueRonisha Informatics Private Limited Catalogue
Ronisha Informatics Private Limited Catalogue
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptxThe Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
The Role of IoT and Sensor Technology in Cargo Cloud Solutions.pptx
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Effectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryErrorEffectively Troubleshoot 9 Types of OutOfMemoryError
Effectively Troubleshoot 9 Types of OutOfMemoryError
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
Revolutionizing the Digital Transformation Office - Leveraging OnePlan’s AI a...
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
Best Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh ITBest Angular 17 Classroom & Online training - Naresh IT
Best Angular 17 Classroom & Online training - Naresh IT
 
SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?SAM Training Session - How to use EXCEL ?
SAM Training Session - How to use EXCEL ?
 
Zer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdfZer0con 2024 final share short version.pdf
Zer0con 2024 final share short version.pdf
 
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full RecordingOpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
OpenChain Education Work Group Monthly Meeting - 2024-04-10 - Full Recording
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 

Functions in C

  • 1.
  • 3. Definition A Function is a self-contained block of statement that perform a task of some kind. OR Function is a set of instruction to carryout a particular task. Function after its execution returns a single value when we call it in our program. Functions in C
  • 4. 1.Built-in-Functions • The built-in-function are also called library function or Standard Function. These functions are provided by programmer. • printf(); and scanf(); are Some common types of built-in-Functions. 2.User-Defined Fun. • Defined by user at the time of writing the program. User set these program for her own uses. • Add(); Max(); etc are some kinds of user- defined functions. Functions in C
  • 5. Need of functions • Enabling code reuse • Better readability • Improved debugging and testing • Improved maintainability • Reduce lines of code Functions in C
  • 6. Steps of User-Defined-F. There are three steps of working with user Defined functions: 1. Function Declaration, also known as function prototype 2. Function Dentition means body of function. 3. Function use, also known as function call. Functions in C
  • 7. Programs. • Simple program by Function :- #include<stdio.h> void massage();/*Function prototype declaration*/ void main() { void massage();/*function call*/ } void massage()/*function definition*/ { printf(“This is a simple program"); } start Function call Void massag Output end Out put :- This is simple program
  • 8. To find area and circumference of circle. #include<stdio.h> #define PI 3.14159 float carea(float); float ccir(float); void main() { float radius; printf("Enter floater Radius:"); scanf("%f",&radius); carea(radius); ccir(radius); getch(); } float carea(float radius) { float area; area=PI*radius*radius; printf("Area= %fn",area);} float ccir(float radius) { float ccir; cir=2*PI*radius; printf("Circumference= %f",cir);} • Flo. Programs. start Input radius Function call Float carea,crim area=PI*radius*radius cir=2*PI* radius Output Area,Cri end Enter floater Radius _5.0 Area=78.53975 Circumference=31.4159
  • 9. To find area and circumference of cube. #include<stdio.h> #define PI 3.14159 float carea(float); float ccir(float); void main() { float radius; printf("Enter floater Radius:"); scanf("%f",&radius); carea(radius); ccir(radius); getch(); } float carea(float radius) { float area; area=4*PI*radius*radius; printf("Area= %fn",area);} float ccir(float radius) { float ccir; cir=4/3*PI*radius*radius*radius*; printf("Circumferernce= %f",cir);} Programs. start Input radius Function call Float carea,crim area=4*PI*radius*radius cir=4/3*PI* radius* radius*radius Output Area,Cir end Enter floater Radius _5.0 Area=1570.795 Circumference=523.59833335
  • 10. To Exchange Values of 2 variables. include<stdio.h> void swap(int *x, int *y); void main() { int x, y; printf("nEnter First number : "); scanf("%d", &x); printf("nEnter Second number : "); scanf("%d", &y); printf("nBefore Swaping x = %d and y = %d", x, y); swap(&x, &y); printf("nAfter Swaping x = %d and y = %d", x, y); getch();} void swap(int *x, int *y) { int temp; temp = *x; *x = *y; *y = temp;} Programs. start Input x,y Output Values of x and y end Function call Void swap Temp=*x *x=*y Y=*temp Enter First number_4 Enter Second number_8 Before Swaping x=4 and y=8 After Swaping x=8 and y=4