<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>function overloading | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/function-overloading/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Sat, 13 Mar 2010 12:32:40 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ program to swap two variables using function overloading</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-swap-two-variables-using-function-overloading/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-swap-two-variables-using-function-overloading/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Sat, 13 Mar 2010 12:32:40 +0000</pubDate>
				<category><![CDATA[Advanced programs]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[function overloading]]></category>
		<category><![CDATA[swap numbers]]></category>
		<category><![CDATA[string swaping]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1050</guid>

					<description><![CDATA[<p>FUNCTION OVERLOADING AIM: A program to demonstrate how function overloading is carried out for swapping of two variables of the various data types, namely integer, floating point number and character types ALGORITHAM: • Start the process • Get the integer values of ix,iy • Get the floating values of fx,fy • Get the character values</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-swap-two-variables-using-function-overloading/">C++ program to swap two variables using function overloading</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>FUNCTION OVERLOADING</p>
<p><strong>AIM: </strong><br />
A program to demonstrate how function overloading is carried out for swapping of two variables of the various data types, namely integer, floating point number and character types</p>
<p><strong>ALGORITHAM: </strong></p>
<p>•	Start the process<br />
•	Get the integer values of ix,iy<br />
•	Get the floating values of fx,fy<br />
•	Get the character values of cx,cy<br />
•	Call swap(ix,iy)<br />
o	Assign temp<-a
o	Assighn a<-b,b<-temp
•	Swapping the integer values
•	Print the value of ix and iy
•	Swapping floating values
•	Print the values oh fx and fy
•	Swapping on characters
•	Print the value of cx,cy
•	Stop the process

<strong>PROGRAM</strong></p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
void swap(int &ix,int &iy);
void swap(float &fx,float &fy);
void swap(char &cx,char &cy);
void main()
{
		int ix,iy;
float fx,fy;
char cx,cy;
clrscr();
cout<<"Enter 2 integers:";
cin>>ix>>iy;
cout<<"Enter 2 floating point no:s:";
cin>>fx>>fy;
cout<<"Enter 2 characters:";
cin>>cx>>cy;
cout<<"\nIntegers:";
cout<<"\nix="<<ix<<"\niy="<<iy;
swap(ix,iy);
cout<<"\nAfter swapping";
cout<<"\nix="<<ix<<"\niy="<<iy;
cout<<"\nFloating point no:s";
cout<<"\nfx="<<fx<<"\nfy="<<fy;
swap(fx,fy);
cout<<"\nAfter swapping";
cout<<"\nfx="<<fx<<"\nfy="<<fy;
cout<<"\nCharacters";
cout<<"\ncx="<<cx<<"\ncy="<<cy;
swap(cx,cy);
cout<<"\nAfter swapping";
cout<<"\ncx="<<cx<<"\ncy="<<cy;
getch();
}
void swap(int &#038;a,int &#038;b)
{
int temp;
temp=a;
a=b;
b=temp;
}
void swap(float &#038;a, float &#038;b)
		{
float temp;
temp=a;
a=b;
b=temp;
}
void swap(char &#038;a, char &#038;b)
{
char temp;
temp=a;
a=b;
b=temp;
}
</pre>
<p><strong>Output:</strong></p>
<p>	Enter 2 integers: 100 200<br />
	Enter 2 floating point no:s :-11.11  22.22<br />
	Enter 2 characters: s t</p>
<p>Integers:<br />
Ix=100<br />
Iy=200<br />
After swapping<br />
Ix=200<br />
Iy=100<br />
Floating point no:<br />
Fx=-11.11<br />
Fy=22.22<br />
After swapping<br />
Fx=22.22<br />
Fy=-11.11<br />
Characters<br />
Cx=s<br />
Cy=t<br />
After swapping<br />
Cx=t<br />
Cx=s</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-swap-two-variables-using-function-overloading/">C++ program to swap two variables using function overloading</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-advanced/c-program-to-swap-two-variables-using-function-overloading/feed/</wfw:commentRss>
			<slash:comments>21</slash:comments>
		
		
			</item>
	</channel>
</rss>
