From ec82c210753221fe7132169f1d474a019b5c9cdf Mon Sep 17 00:00:00 2001 From: Jose-maria FULLANA Date: Wed, 6 Oct 2021 20:19:41 +0200 Subject: [PATCH] =?UTF-8?q?Transf=C3=A9rer=20les=20fichiers=20vers=20'TP2'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- TP2/exo2.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 TP2/exo2.c diff --git a/TP2/exo2.c b/TP2/exo2.c new file mode 100644 index 0000000..1cce3ba --- /dev/null +++ b/TP2/exo2.c @@ -0,0 +1,19 @@ +#include + +int main () { + int a = 5, b=10; + /********************************/ + /* avec une variable auxiliaire */ + /********************************/ + int aux=a; + a=b; + b=aux; + /********************************/ + /* sans variable auxiliaire */ + /********************************/ + a = 5, b=10; + a=a+b; + b=a-b; + a=a-b; + return 1; +}