// another swapping example
#include<iostream>
using namespace std;

void swap2(int *p, int *q) {
 int temp = *p;
 *p = *q; *q = temp;
}

int main() {
 int p = 1; int q = 2;
 cout << "The initial values of p and q are: " << p << "  " << q << endl;
 swap2(&p,&q);
 cout << "The final values of p and q are: " << p << "  " << q << endl;
}
