Add inversion-variables

This commit is contained in:
flyingscorpio@pinebookpro 2021-10-12 09:20:11 +02:00
parent 94afcf9bc9
commit 3e73a20ee6
2 changed files with 26 additions and 3 deletions

View file

@ -1,7 +1,10 @@
all: convertisseur-devises
all: convertisseur-devises inversion-variables
convertisseur-devises: convertisseur-devises.c
gcc convertisseur-devises.c -o convertisseur-devises
cc convertisseur-devises.c -o convertisseur-devises
inversion-variables: inversion-variables.c
cc inversion-variables.c -o inversion-variables
clean:
rm -f convertisseur-devises
rm -f convertisseur-devises inversion-variables

View file

@ -0,0 +1,20 @@
/* 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;
}