Quick actions

cmd+k|ctrl+k

Navigation

Languages

swap by address

Snippet info

Language

Cpp

Visibility

public

Author

mothilaljadav0304

Created

2026-06-29T16:33:20.533464Z

Updated

2026-06-29T16:33:20.533464Z

#include <iostream>
using namespace std;

void swap(int *a, int *b){
    int temp = *a;
    *a = *b;
    *b = temp;
}

int main() {
    int x = 10, y=20;
    swap(&x,&y);
    cout<<x<<" "<<y;
    return 0;
}
INFO