#include <stdio.h>

int x = 10, y = 20;

// NON FUNZIONA!
void scambia(int a, int b) {
    int temp = a;
    a = b;
    b = temp;
}

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

int main() {
    printf("%d %d\n",x,y);
    scambia(x,y);
    printf("%d %d\n",x,y);
    scambiap(&x,&y);
    printf("%d %d\n",x,y);
}

Embed on website

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