fork download
  1. #include <iostream>
  2. using namespace std;
  3. int x,y,dep;
  4.  
  5.  
  6. int main() {
  7. x=5;
  8. y=7;
  9.  
  10.  
  11. cout<<"prima x= "<<x<<"\t"<<"y= "<<y<<endl;
  12. //swap
  13.  
  14. dep=x;
  15. x=y;
  16. y=dep;
  17.  
  18. cout<<"dopo x= "<<x<<"\t"<<"y= "<<y<<endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5316KB
stdin
Standard input is empty
stdout
prima x= 5	y= 7
dopo x= 7	y= 5