APL/APL1.1/TP15/echange.c

18 lines
267 B
C
Raw Normal View History

2021-10-18 16:28:46 +02:00
#include<stdio.h>
#include<stdlib.h>
void swap(int* x, int* y) {
int z = *x;
*x = *y;
*y = z;
}
int main(int argc, char * argv[]) {
int x = 10, y = 3;
printf("x = %d; y = %d\n", x, y);
swap(&x, &y);
printf("x = %d; y = %d\n", x, y);
return EXIT_SUCCESS;
}