Skip to main content

Featured

functions in Python

c++ program to swap two numbers using third variable

// Following Program swaps two numbers using third variable
#include<iostream.h>
void main()
{
int a,b;
cout<<"\nEnter two numbers\n";
cin>>a>>b;
cout<<"\nNumbers before swapping "<<a<<"\t"<<b<<"\n";
int c;
c=a;
a=b;
b=c;
cout<<"\nNumbers after swapping  "<<a<<"\t"<<b<<"\n";
}

OUTPUT:

Comments

Popular Posts