C++ Program To Swap 2 Numbers With Third Variable

      No Comments on C++ Program To Swap 2 Numbers With Third Variable
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int x=5,y=10,z;
cout<<"Value of x before swaping:- "<<x<<endl;
cout<<"Value of y before swaping:- "<<y<<endl;
z=x;
x=y;
y=z;
cout<<"Value of x after swaping:- "<<x<<endl;
cout<<"Value of y after swaping:- "<<y<<endl;
getch();
}
OUTPUT:-

scanfcode2

Leave a Reply

Your email address will not be published. Required fields are marked *