From 5d226824fa54ea4eadadeb787ee8c9bba7c4df07 Mon Sep 17 00:00:00 2001 From: zohikoim Date: Wed, 23 Sep 2026 12:25:49 +0200 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20mes=20travaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DEV1.1/TP01/TP02Q2.c | 16 ++++++++++++++++ DEV1.1/TP01/bases.c | 9 +++++++++ DEV1.1/TP01/limites.c | 21 +++++++++++++++++++++ DEV1.1/TP05/TP05Q2 | 4 ++++ DEV1.1/TP05/TP05Q3 | 12 ++++++++++++ DEV1.1/TP05/interets.c | 16 ++++++++++++++++ DEV1.1/TP05/poussieres.c | 16 ++++++++++++++++ DEV1.1/TP05/telescopage.c | 23 +++++++++++++++++++++++ DEV1.1/TP06/#ordre.c# | 4 ++++ DEV1.1/TP06/billevesees | Bin 0 -> 16024 bytes DEV1.1/TP06/billevesees.c | 26 ++++++++++++++++++++++++++ DEV1.1/TP06/ordre.c | 2 ++ DEV1.1/TP06/produit.c | 22 ++++++++++++++++++++++ DEV1.1/TP06/triple.c | 14 ++++++++++++++ DEV1.1/TP07/#tables.c# | 0 DEV1.1/TP07/division.c | 15 +++++++++++++++ DEV1.1/TP07/filtrage.c | 6 ++++++ DEV1.1/TP07/sequence.c | 0 DEV1.1/TP07/table.c | 8 ++++++++ DEV1.1/TP07/tables.c | 0 reponses.txt | 10 ++++++++++ 21 files changed, 224 insertions(+) create mode 100644 DEV1.1/TP01/TP02Q2.c create mode 100644 DEV1.1/TP01/bases.c create mode 100644 DEV1.1/TP01/limites.c create mode 100644 DEV1.1/TP05/TP05Q2 create mode 100644 DEV1.1/TP05/TP05Q3 create mode 100644 DEV1.1/TP05/interets.c create mode 100644 DEV1.1/TP05/poussieres.c create mode 100644 DEV1.1/TP05/telescopage.c create mode 100644 DEV1.1/TP06/#ordre.c# create mode 100755 DEV1.1/TP06/billevesees create mode 100644 DEV1.1/TP06/billevesees.c create mode 100644 DEV1.1/TP06/ordre.c create mode 100644 DEV1.1/TP06/produit.c create mode 100644 DEV1.1/TP06/triple.c create mode 100644 DEV1.1/TP07/#tables.c# create mode 100644 DEV1.1/TP07/division.c create mode 100644 DEV1.1/TP07/filtrage.c create mode 100644 DEV1.1/TP07/sequence.c create mode 100644 DEV1.1/TP07/table.c create mode 100644 DEV1.1/TP07/tables.c create mode 100644 reponses.txt diff --git a/DEV1.1/TP01/TP02Q2.c b/DEV1.1/TP01/TP02Q2.c new file mode 100644 index 0000000..1f6700f --- /dev/null +++ b/DEV1.1/TP01/TP02Q2.c @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { + printf("%d\n", 100/6); + printf("%d\n", 100%6); + printf("%d\n", 0x1A*015); + printf("%d\n", -3/5); + printf("%d\n", -31/5); + printf("%d\n", -31%5); + printf("%d\n", 100*(3/5)); + printf("%d\n", 100*3/5); + printf("%d\n", 2-3-5); + printf("%d\n", 2-(3-5)); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP01/bases.c b/DEV1.1/TP01/bases.c new file mode 100644 index 0000000..5530e1a --- /dev/null +++ b/DEV1.1/TP01/bases.c @@ -0,0 +1,9 @@ +#include +#include + +int main(void) { + printf("%d\n", 72); + printf("%d\n", 0110); + printf("%d\n", 0x48); + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP01/limites.c b/DEV1.1/TP01/limites.c new file mode 100644 index 0000000..ae865aa --- /dev/null +++ b/DEV1.1/TP01/limites.c @@ -0,0 +1,21 @@ +#include +#include + +int main(void) +{ + int n = 1; // qui va augmenter + int precedent = 1; // on garde la derniere + + while (n > 0) // tant que n est + pcq basculer en - cest le signal d'arret, le nb est rempli de 1) + { + precedent = n; // on garde la veleur avant de depasser la limite + n = n*2+1; // o doube a chaque fois et on ajoute & pour les bits + } + + printf("plus grand entier : %d\n", precedent); + printf("en octal : %o\n", precedent); + printf"en hexa : %x\n", precedent); + + return EXIT_SUCCESS; + +} diff --git a/DEV1.1/TP05/TP05Q2 b/DEV1.1/TP05/TP05Q2 new file mode 100644 index 0000000..9d0aaaf --- /dev/null +++ b/DEV1.1/TP05/TP05Q2 @@ -0,0 +1,4 @@ +OPERATIONS (trouvez ou est l'erreur dans le programme) + +l'erreur est à la dernière ligne ici : printf("%f\n", 5.0%2.5); + diff --git a/DEV1.1/TP05/TP05Q3 b/DEV1.1/TP05/TP05Q3 new file mode 100644 index 0000000..209cd78 --- /dev/null +++ b/DEV1.1/TP05/TP05Q3 @@ -0,0 +1,12 @@ +EXTREMITES + +int main(void) { + printf("%f\n", +1.0/0.0); + printf("%f\n", -1.0/0.0); + printf("%f\n", -0.0/0.0); + return EXIT_SUCCESS; +} + +le premier printf : +1.0/0.0 donnera + l'infini car on divise un réel positif par 0 +le second printf : -1.0/0.0 donnera - l'infini car on divise un réél négatif par 0 +le dernier print f : -0.0/0.0 donnera une forme indéterminée \ No newline at end of file diff --git a/DEV1.1/TP05/interets.c b/DEV1.1/TP05/interets.c new file mode 100644 index 0000000..c9d72a6 --- /dev/null +++ b/DEV1.1/TP05/interets.c @@ -0,0 +1,16 @@ +#include +#include + +int main(void) { + double capital ; + printf("Combien d'euros voulez vous investir?"); + scanf("%f", capital); + + capital = capital * 1,04; + printf("Après 1 an : %.2f euros\n", captital); + + capital = capital * 1,04; + printf("Après 2 ans : %.2f euros\n", captital); + + capital = capital * 1,04; + printf("Après 1 an : %.2f euros\n", captital); diff --git a/DEV1.1/TP05/poussieres.c b/DEV1.1/TP05/poussieres.c new file mode 100644 index 0000000..082045b --- /dev/null +++ b/DEV1.1/TP05/poussieres.c @@ -0,0 +1,16 @@ +#include +#include +int main(void) { + printf("%f\n", 12345.678910111213); + return EXIT_SUCCESS; +} + +int main2(void) { + printf("%.12f\n", 12345.678910111213); + return EXIT_SUCCESS; +} + +int main3(void) { + printf("%.15f\n", 12345.678910111213); + return EXIT_SUCCESS; +} diff --git a/DEV1.1/TP05/telescopage.c b/DEV1.1/TP05/telescopage.c new file mode 100644 index 0000000..401b296 --- /dev/null +++ b/DEV1.1/TP05/telescopage.c @@ -0,0 +1,23 @@ +#include +#include + +int main(void) { + float nombre ; + char caractere; + + printf("entrez un réel : "); + scanf("%f", nombre); + + printf("en notation sci : %e\n", nombre); + + printf("entrez un caractere : "); + scanf(" %c", caractere); + + printf("%c", caractere); + printf("%c", caractere); + printf("%c", caractere); + printf("%c", caractere); + printf("%c", caractere); + + return EXIT_SUCCESS; +} \ No newline at end of file diff --git a/DEV1.1/TP06/#ordre.c# b/DEV1.1/TP06/#ordre.c# new file mode 100644 index 0000000..3f48fa2 --- /dev/null +++ b/DEV1.1/TP06/#ordre.c# @@ -0,0 +1,4 @@ +#include +#include + +print \ No newline at end of file diff --git a/DEV1.1/TP06/billevesees b/DEV1.1/TP06/billevesees new file mode 100755 index 0000000000000000000000000000000000000000..dcb89d76b602ca95f561373e14a52584ac0ffa53 GIT binary patch literal 16024 zcmb<-^>JfjWMqH=W(GS35HCOgBH{p{7;czB84L^z4h$9y{0t5Z@(gkeYzzzxEMPH+ zJWM@|_F#sH!)Oi&mjNUU(zgc0U|?WCr)8k(U^K{0AR!P9(g$K=!v!D*F)%Q|Xa=Z1 zK>Aog8lZfbIE;P>Qoz8#0Ha~zAYrh53Lwo43=C-W0gwU)1_l_7tPkXr3%U?}7i>}K z044}O0!qX5fw&-j51{%UK=r|CsC^HhG%P$pZUo^DXn3O2DiG@!U^GZANC-rOaDpO; z$H0J2!{QM}quaLtst=t;3np+H0of4zv?PTb`vRc)44?+1(=dO*XpkKs`$C}lZb0>+ z(;Xm13=9k~8s@*irzI(%cz{Y1q+rP^2x=d$csBq=FarYvjD|)dIDAAH7{K|$-7l2k zp6JQjOBvbD{hN8M-)rf#oafV&W%P40lgv!?b5eA3GV@9+bSo^(bj?ikiu3i1zEi*4MC$lP*p`a);uOy8DqzV)+W(@8=o=(p3 zMtVkirf{~g2}8VRh;MvKYEf!>W^qYsQHZZ|PJUi$NMce>DnopHd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>4`KRX=@7IW7Ni8GAGW{k05suffGkDAF#RwZw51tYKdis_f=K;bjG+Dk zXy+cp5?DJ_0Gjb&?u5ufJBKh1Xs;h5L=5JBSi2E4hYC^#b0>%m!XUSTXc!iS+7Go3 zCd>fSk6wPj^dr--v=7$|>IXv&tbjU97P@Z}<{nU422#(76!#!L4DT?8u>Qj=f^b3I Y3MdOgfttfmD +#include + +int main(void) { + int x=3; + + if (x=2) { + printf("x vaut 2\n"); + } else { + printf("x est different de 2\n"); + } + + printf("%d\n", x); + + if (x=0) { + printf("x vaut 0\n"); + } else { + printf("x est different de 0\n"); + } + + printf("%d\n", x); + + return EXIT_SUCCESS; +} + +/* il faut le double symbole égal dans les deux if */ diff --git a/DEV1.1/TP06/ordre.c b/DEV1.1/TP06/ordre.c new file mode 100644 index 0000000..fbfff34 --- /dev/null +++ b/DEV1.1/TP06/ordre.c @@ -0,0 +1,2 @@ +#include +#include diff --git a/DEV1.1/TP06/produit.c b/DEV1.1/TP06/produit.c new file mode 100644 index 0000000..85e0bd2 --- /dev/null +++ b/DEV1.1/TP06/produit.c @@ -0,0 +1,22 @@ +#include +#include + +int main(void) { + int a; + int b; + + printf("entrez un premier réel :"); + scanf("%d", &a); + printf("entrez un second réel:"); + scanf("%d", &b); + + int multiplication = a * b + + if (multiplication < 0) + printf("le signe de la multiplication est négatif"); + else + printf("le signe de la multiplication est positif"); + + return EXIT_SUCCESS; +} + diff --git a/DEV1.1/TP06/triple.c b/DEV1.1/TP06/triple.c new file mode 100644 index 0000000..de804d4 --- /dev/null +++ b/DEV1.1/TP06/triple.c @@ -0,0 +1,14 @@ +#include +#include + +int main(void) { + int n ; + + printf("entrez un entier naturel :"); + scanf(%d, &n); + + + + + + return EXIT_SUCCESS diff --git a/DEV1.1/TP07/#tables.c# b/DEV1.1/TP07/#tables.c# new file mode 100644 index 0000000..e69de29 diff --git a/DEV1.1/TP07/division.c b/DEV1.1/TP07/division.c new file mode 100644 index 0000000..bc5ef48 --- /dev/null +++ b/DEV1.1/TP07/division.c @@ -0,0 +1,15 @@ +int a, b ; + +printf("entrez une valeur entière supérieure ou égal à 0 :"); +scanf("%d", &a); + +printf("entrez une valeur entière strictement supérieure à 0 :"); +scanf("%d", &b); + +int quotient = 0, reste = a ; +while (reste >= b) { + reste = reste - b; + quotient = quotient + 1; + }; + +printf("--> %d = %d * %d + %d", a , quotient, b, reste); diff --git a/DEV1.1/TP07/filtrage.c b/DEV1.1/TP07/filtrage.c new file mode 100644 index 0000000..56e7e2f --- /dev/null +++ b/DEV1.1/TP07/filtrage.c @@ -0,0 +1,6 @@ +double inv; +("Entrez une valeur d'investissement comprise entre 1000 euros et 10000 euros"); +scanf("%f", inv); + +while ( 1000 >= inv <= 10000) { + pr diff --git a/DEV1.1/TP07/sequence.c b/DEV1.1/TP07/sequence.c new file mode 100644 index 0000000..e69de29 diff --git a/DEV1.1/TP07/table.c b/DEV1.1/TP07/table.c new file mode 100644 index 0000000..ad7d895 --- /dev/null +++ b/DEV1.1/TP07/table.c @@ -0,0 +1,8 @@ +int x, y, z; +printf("entrez un entier : "); +scanf("%d", &x); + +while (y <= 10) { + z = x*y; + printf("%d * %d = %d", x, y, z) + }; diff --git a/DEV1.1/TP07/tables.c b/DEV1.1/TP07/tables.c new file mode 100644 index 0000000..e69de29 diff --git a/reponses.txt b/reponses.txt new file mode 100644 index 0000000..b9cd9dc --- /dev/null +++ b/reponses.txt @@ -0,0 +1,10 @@ +16 (la partie decimale de 16.666 coupé) +4 (reste) + +0 ( -0.6 arrondit) +-6 (-6.2 arrondit?) +-1 (reste) +0( la parenthèse fait 0.6 arrondit a 0 le tout fois 100.) +60 (300 par 5 ca fait 60) +-6 +4