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