efrei/programmation-c-cpp/tp1/inversion-variables.c

21 lines
301 B
C
Raw Normal View History

2021-10-12 09:20:11 +02:00
/* Inversion de variables */
#include <stdio.h>
#include <stdlib.h>
int main() {
int tmp;
int var1 = 123;
int var2 = 18;
printf("var1=%d et var2=%d\n", var1, var2);
tmp = var1;
var1 = var2;
var2 = tmp;
printf("var1=%d et var2=%d\n", var1, var2);
return 0;
}