#include <iostream>
using namespace std;

int main() {
    int a, b, temp;

    cout << "Ingrese el valor de la primera variable (a): ";
    cin >> a;
    cout << "Ingrese el valor de la segunda variable (b): ";
    cin >> b;


    temp = a; 
    a = b;
    b = temp;

    cout << "Después del intercambio:" << endl;
    cout << "a = " << a << endl;
    cout << "b = " << b << endl;

    return 0;
}

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: