DEV/DEV1.1/TP16/tests.c

22 lines
334 B
C
Raw Normal View History

2024-10-09 09:59:41 +02:00
# include <stdio.h>
# include <stdlib.h>
void inverse_variables(int a, int b) {
int temp;
temp = a;
a = &b;
b = &temp;
}
int main(void) {
int x, y;
x = 12;
y = 5;
printf("avant : x = %d y = %d\n", x, y);
inverse_variables(x, y);
printf("avant : x = %d y = %d\n", x, y);
return EXIT_SUCCESS;
}