OneCompiler

swaping the two numbers

111

#include <iostream>
using namespace std;
int main(){
int x ;
int y ;
cout<<"enter the value of X = \n";
cin>>x;
cout<<"enter the value of Y = \n";
cin>>y;
x = x+y;
y = x-y;
x = x-y;
cout<<"value of X = "<<x<<"\n";
cout<<"value of Y = "<<y<<"\n";
return 0;
}