The output is shown as comments after the statements generating it.
#include <iostream>
using namespace std;
int main(){
    int i = 5, j = 7, k;
    int* p, *q;
    p = &i;
    q = &j;

    cout << i << ' ' << j << endl;  // 5 7
    k = *p;
    *p = *q;
    *q = k;
    cout << i << ' ' << j << endl;  // 7 5
    return 0;
}