C C++ Programming with Kailash Chandrasekar
Let your simple dreams come true in programming...
Sunday, March 7, 2010
C++ PROGRAM TO INTERCHANGE TWO VALUES WITHOUT USING THE THIRD VARIABLE..
void main(){
int x,y;
clrscr();
cout<<"ENTER THE VALUES OF X AND Y :";
cin>>x>>y;
cout<<"BEFORE CHANGING";
cout<<"\n X = "<
<<"\n Y = "<
<
cout<<"AFTER CHANGING";
x=x+y;
y=x-y;
x=x-y;
cout<<"\n X = "<
<<"\n Y = "<
<
getch();
}
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment