All pastes #31101 Raw Edit

Mine

public text v1 · immutable
#31101 ·published 2005-11-25 04:01 UTC
rendered paste body
#include <iostream.h>

void swap(int x, int y);

int main()
{
    int x = 5, y = 10;
    
     cout << "Main Before Swap, x: " << x << " y : " << y << "\n";
     swap(x,y);
     cout << "Main After Swap, x: " << x << " y: " << y << "\n";
     return 0;
     }
     
     void swap(int x, int y)
     {
          int temp;
          
          cout << "Swap. Before Swap, x: " << x << " y: " << y << "\n";
          
          temp = x;
          x = y;
          y = temp;
          
          cout << "Swap. After Swap, x: " << x << " y: " << y << endl;
          }