From 1e063977ab72d1141c5d993001132af4b1f74161 Mon Sep 17 00:00:00 2001 From: pourchot Date: Wed, 21 Sep 2022 17:54:28 +0200 Subject: [PATCH] 21 septembre --- .../.nfs0000000000461e4800000017 | 15 -------- .../.nfs000000000046254e00000025 | Bin 0 -> 16712 bytes .../.nfs0000000000462b9000000026 | Bin 0 -> 16712 bytes DEV1.1/TP02:Caracteres,Reels/interets.c | 17 ++++++++++ DEV1.1/TP02:Caracteres,Reels/telescopage.c | 9 +++-- DEV1.1/TP03:Conditions/billevesees.c | 18 ++++++++++ DEV1.1/TP03:Conditions/bissextile.c | 6 ++++ DEV1.1/TP03:Conditions/ordre.c | 32 ++++++++++++++++++ DEV1.1/TP03:Conditions/produit.c | 18 ++++++++++ DEV1.1/TP03:Conditions/triple.c | 21 ++++++++++++ 10 files changed, 116 insertions(+), 20 deletions(-) delete mode 100644 DEV1.1/TP02:Caracteres,Reels/.nfs0000000000461e4800000017 create mode 100755 DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 create mode 100755 DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 create mode 100644 DEV1.1/TP02:Caracteres,Reels/interets.c create mode 100644 DEV1.1/TP03:Conditions/billevesees.c create mode 100644 DEV1.1/TP03:Conditions/bissextile.c create mode 100644 DEV1.1/TP03:Conditions/ordre.c create mode 100644 DEV1.1/TP03:Conditions/produit.c create mode 100644 DEV1.1/TP03:Conditions/triple.c diff --git a/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000461e4800000017 b/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000461e4800000017 deleted file mode 100644 index c22099a..0000000 --- a/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000461e4800000017 +++ /dev/null @@ -1,15 +0,0 @@ -#include - -int main(void) { - int n; - double x; - char c; - printf("Veuillez saisir un reel.\n"); - n = scanf("%lf", &x); - printf("Sa notation scientifique est : %f\n",x); - printf("Veuillez saisir un caractere.\n"); - n = scanf("%c", &c); - printf("J'ecris ce dernier 5 fois : %c %c %c %c %c\n",c,c,c,c,c); - - return 0; -} \ No newline at end of file diff --git a/DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 b/DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 new file mode 100755 index 0000000000000000000000000000000000000000..0169f1e24102261d373df576650ad985d4945e3c GIT binary patch literal 16712 zcmeHOZ)_CD6`#Aau?hHm5K~+Tu%TEoZG9Lp#(*5|Y@fZZY;eIQi5ghWcWZmg`OdxD zqsB=UOQumz#3@o!DT-8;w)x;jYRZ>Z`OqRGBdWCh0DNd^+Dc9Ym5Hdh(108wxV|?# z?{0VRjH)WCRB1=ree-_r&&<4?*_*kYc{$Y6>2|poB@cUsAvfkTkbn?W?iCpz0oKA+ zz+wwMY|axx6`MD9#N_xQnXtt^SE9XB0Ivx4FX4*IYk)@#<*S$7 zxN!KL)`u@{_~g}*`}M!*+_2M!wsb-EKThMIDV5M(2iWQo_@*WB#wGC1CGgh)m*BFe z6#$ef_h*1hc4gpq!?n2t&LG|q3~w`26fKpA?AfEFBH{QD8%ygcz*2fRazcrWoKS|s zT8xb)wYWY6cw{`R3~BLjOq)=FMK`FM)Rob&7H3^O-EHm44*%|at|_0};orrS?*3jS zswUN8Ev2i;{@(UjBChs_2V>}Mcr+0g-V{T%q#|#R8=kkD_W|s))E8WU;&Z0{xK`7u zaO6BEuo}*L*r4Fk>$K%)9RnT{jbj>j$5$D6R*X}^eF6^z3_0P%U*B)wIEJu3l;%x1 ze_si~f(bW|yQ~SPGSFnvghK=JsWxC_D}Yc;5Rn3SXAE&1CzR>~MhfT2lr?9uKaQ+(dIJLYr%lY3Uk5kH9=Yhxaw*Rv` zbM=^<`B0v^k?rg6nJ&K%_VRSq%bc`c1?AkDHn98TtUTTN6UfNZU{v#76us&2$Q zRCRf7zIxLnsIxgiLH}D^f7dsWY<(nOeB_ZcS^46^e%Wz>bcL*;`Z6!g>Iu6RC~e;UVro`my@SMSvhkVpwj@o zi{g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5S%7!#w=&r6KKCxLK107Dmk(~Ly(I-;~55Mr)Nd8D6(3+LcuPxC*b63EPn-h+f~ zfsEOn=7~f%lA@q?`wqbG!-bpkobm_bo+0%OB z0LXC)OZGHBB}(fc;if2lhd_X94zj0tEK&R(hKcG=dPI+a4A(Hk(|ng`0F5Ep>u;cp zO+W@?O7=7_CORz?seF6;UlI0gLXYOpL=T(nVHS~JS5o|52MqgP{%jo0+XSWcs&K>W zN_nIixXkvFup`=MR))OIJv(i)r{7tkwGx=?7#v8{zsQcB<8_ds3fa@T=bD&k z)uFK|kv-ABfy`{r0z$dLpe=$WLUu&&fWT}|^UfAwPxZ9h6Mqjf=!@!4^Eg@9Q#quM zWtr0hU=S1Pc@f!*X=ENJdo#`V-MkiKhlN8~1Rlrn=i#FI(D+{r7}ecm&dxR)-19c) UR4(aa{Yu&AMBqI(0~^c!1J*;wp#T5? literal 0 HcmV?d00001 diff --git a/DEV1.1/TP02:Caracteres,Reels/interets.c b/DEV1.1/TP02:Caracteres,Reels/interets.c new file mode 100644 index 0000000..930e674 --- /dev/null +++ b/DEV1.1/TP02:Caracteres,Reels/interets.c @@ -0,0 +1,17 @@ +#include + +int main(void) { + double n; + int i; + i=0; + printf("Combien voulez vous invetir?\n"); + scanf("%lf",&n); + printf("Vous avez investit %.3f euros.\n",n); + while (i!=7){ + n=n+n*0.04; + printf("Apres %d ans votre epargne est de %9.3f euros.\n",i,n); + i=i+1;} + printf("Apres %d ans votre epargne est de %9.3f euros.\n",i,n); + + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP02:Caracteres,Reels/telescopage.c b/DEV1.1/TP02:Caracteres,Reels/telescopage.c index 074d299..5b31aeb 100644 --- a/DEV1.1/TP02:Caracteres,Reels/telescopage.c +++ b/DEV1.1/TP02:Caracteres,Reels/telescopage.c @@ -1,15 +1,14 @@ #include int main(void) { - int n; double x; - char c; printf("Veuillez saisir un reel.\n"); - n = scanf("%lf", &x); + scanf("%lf",&x); printf("Sa notation scientifique est : %e\n",x); printf("Veuillez saisir un caractere.\n"); - n = scanf("%c", &c); + char c; + scanf(" %c",&c); //mettre un espace empeche le programme de lire le retour à la ligne. printf("J'ecris ce dernier 5 fois : %c %c %c %c %c\n",c,c,c,c,c); - return 0; + return 0; } \ No newline at end of file diff --git a/DEV1.1/TP03:Conditions/billevesees.c b/DEV1.1/TP03:Conditions/billevesees.c new file mode 100644 index 0000000..7cd703c --- /dev/null +++ b/DEV1.1/TP03:Conditions/billevesees.c @@ -0,0 +1,18 @@ +#include + +int main(void) { + int x; + 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 0; +} \ No newline at end of file diff --git a/DEV1.1/TP03:Conditions/bissextile.c b/DEV1.1/TP03:Conditions/bissextile.c new file mode 100644 index 0000000..cb04c40 --- /dev/null +++ b/DEV1.1/TP03:Conditions/bissextile.c @@ -0,0 +1,6 @@ +#include + +int main(void) { + + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP03:Conditions/ordre.c b/DEV1.1/TP03:Conditions/ordre.c new file mode 100644 index 0000000..cf2c463 --- /dev/null +++ b/DEV1.1/TP03:Conditions/ordre.c @@ -0,0 +1,32 @@ +#include + +int main(void) { + int a; + int b; + int c; + printf("Veuillez saisir 3 entiers.\n"); + scanf("%d %d %d",&a,&b,&c); + if (a>b){ + if (a>c){ + if (b>c){ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",c,b,a); + } else{ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",b,c,a); + } + } else{ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",b,a,c); + } + } else{ + if (b>c){ + if (a>c){ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",c,a,b); + } else{ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",a,c,b); + } + } else{ + printf("Dans l'ordre croisant, les valeurs sont: %d %d %d\n",a,b,c); + } + } + + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP03:Conditions/produit.c b/DEV1.1/TP03:Conditions/produit.c new file mode 100644 index 0000000..1ed4e30 --- /dev/null +++ b/DEV1.1/TP03:Conditions/produit.c @@ -0,0 +1,18 @@ +#include + +int main(void) { + float n; + float m; + printf("Veuillez saisir 2 reels.\n"); + scanf("%f %f",&n,&m); + if (n>0 && m>0){ + printf("Le produit sera positif.\n"); + } else{ + if (n<0 && m<0){ + printf("Le produit sera positif.\n"); + } else{ + printf("Le produit sera negatif.\n"); + } + } + return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP03:Conditions/triple.c b/DEV1.1/TP03:Conditions/triple.c new file mode 100644 index 0000000..7a926b6 --- /dev/null +++ b/DEV1.1/TP03:Conditions/triple.c @@ -0,0 +1,21 @@ +#include + +int main(void) { + int n; + printf("Veuillez saisir un entier naturel.\n"); + scanf("%d",&n); + if (n%3==0 || n%3==1){ + if (n%3==0){ + printf("%d est deja un multiple de 3.\n",n); + } else { + printf("Le multiple de 3 le plus proche est %d\n",n-1); + } + + } else { + if (n%3==2){ + printf("Le multiple de 3 le plus proche est %d\n",n+1); + } + + } + return 0; +} \ No newline at end of file