DEV/DEV1.1/TP10:Fonctions/echange.c

18 lines
243 B
C
Raw Permalink Normal View History

2022-11-09 17:12:39 +01:00
#include <stdio.h>
#include <stdlib.h>
void echange(int* a , int* b){
int c;
c=*a;
*a=*b;
*b=c;
}
int main(void) {
int x=14;
int y=29;
printf("avant : %d %d\n", x, y);
echange(&x,&y);
printf("apres : %d %d\n", x, y);
return 0;
}