Sunday, December 16, 2012

SWAPPING NUMBERS IN C++


#include<iostream.h>
void main()
{
int a, b, c;
cout<<"\nENTER FIRST NUMBER : ";
cin>>a;
cout<<"\nENTER SECOND NUMBER : ";
cin>>b;
c=a;
a=b;
b=c;
cout<<"\nNEW FIRST NUMBER= "<<a;
cout<<"\nNEW SECOND NUMBER= "<<b;
}

No comments: