22 lines
334 B
C
22 lines
334 B
C
|
|
||
|
# 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;
|
||
|
}
|