#include<iostream>

class clsswap{
    public:
        void swap(int*,int*);
};

void clsswap::swap(int *a,int *b){
    int tmp;
    tmp=*a;
    *a=*b;
    *b=tmp;
}

int main(){
    int a,b;
    clsswap c;
    std::cin>>a>>b;
    c.swap(&a,&b);
    std::cout<<"swapped values: "<<a<<" "<<b;
}

Embed on website

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