From d4c676ea16e024ae1d3e8dc2d796145c8cc46b13 Mon Sep 17 00:00:00 2001 From: pourchot Date: Wed, 28 Sep 2022 16:42:11 +0200 Subject: [PATCH] 28 Septembre --- .../TP04:Types/.nfs00000000005e220a00000065 | Bin 16664 -> 0 bytes DEV1.1/TP05:Boucles/division.c | 18 ++++++++++++++ DEV1.1/TP05:Boucles/filtrage.c | 12 ++++++++++ DEV1.1/TP05:Boucles/sequencedo.c | 22 ++++++++++++++++++ DEV1.1/TP05:Boucles/sequencefor.c | 20 ++++++++++++++++ DEV1.1/TP05:Boucles/sequencewhile.c | 22 ++++++++++++++++++ DEV1.1/TP05:Boucles/table.c | 12 ++++++++++ 7 files changed, 106 insertions(+) delete mode 100755 DEV1.1/TP04:Types/.nfs00000000005e220a00000065 create mode 100644 DEV1.1/TP05:Boucles/division.c create mode 100644 DEV1.1/TP05:Boucles/filtrage.c create mode 100644 DEV1.1/TP05:Boucles/sequencedo.c create mode 100644 DEV1.1/TP05:Boucles/sequencefor.c create mode 100644 DEV1.1/TP05:Boucles/sequencewhile.c create mode 100644 DEV1.1/TP05:Boucles/table.c diff --git a/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 b/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 deleted file mode 100755 index 29d9c026fd3702f1ba164f86852a0a949e07e6a3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16664 zcmeHOU2Ggz6~4P0Cr%Tu9oK105}Iv^r47Ur$8j8+%FV3pb;gyQgv1UhG#RgV$Mz`u z6Yb6xJ0KCsrF0eCS}Hu02dH=|4+x$h5(pe63PSMUAQb{Fl8I7qP#}i<$fSywbMD+T zJ2ShEfCql0x$@4r=Q}_5%$a*W#T;0t_lT$ zcT-KoL6qcHdm%K265>aTcAx?jqINqBWwDuy*DScsx7mZKjS39N@h$d%JJ6J|uo?o(hVQY|zdPblrjM0=~{rBTFB zRGco`lhjAs+x8?A%}G6-pKPA&Xm4(BlX4lUm7h2IN8L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.1/TP05:Boucles/division.c @@ -0,0 +1,18 @@ +#include + +int main() { + int n; + int m; + int i; + int r; + i=0; + printf("Veuillez saisir un entier positif ou nul suivit d'un entier strictement positif separer d'un espace: "); + scanf("%d",&n); + scanf(" %d",&m); + r=n; + while ((r-m)>0){ + r=r-m; + i++; + } printf("%d = %d x %d + %d\n",n,i,m,r); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP05:Boucles/filtrage.c b/DEV1.1/TP05:Boucles/filtrage.c new file mode 100644 index 0000000..0d6c467 --- /dev/null +++ b/DEV1.1/TP05:Boucles/filtrage.c @@ -0,0 +1,12 @@ +#include + +int main() { + float n; + printf("Veuillez saisir votre de bac.\n"); + scanf("%f",&n); + while (n<0 || n>20){ + printf("Erreur, la note n'est pas comprise entre 0 et 20, veuillez repeter.\n"); + scanf("%f",&n); + } printf("Votre note au bac est de %.2f.\n",n); +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP05:Boucles/sequencedo.c b/DEV1.1/TP05:Boucles/sequencedo.c new file mode 100644 index 0000000..f462d13 --- /dev/null +++ b/DEV1.1/TP05:Boucles/sequencedo.c @@ -0,0 +1,22 @@ +#include + +int main() { +int n; +int m; +int i; +printf("Veuillez saisir 2 entiers separer d'un espace.\n"); +scanf("%d",&n); +scanf(" %d",&m); +if (n>m){ + do { + printf("%d\n",m); + m++; + } while (n>=m); +} else{ + do { + printf("%d\n",n); + n++; + } while (m>=n); +} +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP05:Boucles/sequencefor.c b/DEV1.1/TP05:Boucles/sequencefor.c new file mode 100644 index 0000000..6bc25f1 --- /dev/null +++ b/DEV1.1/TP05:Boucles/sequencefor.c @@ -0,0 +1,20 @@ +#include + +int main() { +int n; +int m; +int i; +printf("Veuillez saisir 2 entiers separer d'un espace.\n"); +scanf("%d",&n); +scanf(" %d",&m); +if (n>m){ + for (i=m;i<=n;i++){ + printf("%d\n",i); + } +} else{ + for (i=n;i<=m;i++){ + printf("%d\n",i); + } +} +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP05:Boucles/sequencewhile.c b/DEV1.1/TP05:Boucles/sequencewhile.c new file mode 100644 index 0000000..02a395a --- /dev/null +++ b/DEV1.1/TP05:Boucles/sequencewhile.c @@ -0,0 +1,22 @@ +#include + +int main() { +int n; +int m; +int i; +printf("Veuillez saisir 2 entiers separer d'un espace.\n"); +scanf("%d",&n); +scanf(" %d",&m); +if (n>m){ + while (n>=m){ + printf("%d\n",m); + m++; + } +} else{ + while (m>=n){ + printf("%d\n",n); + n++; + } +} +return 0; +} \ No newline at end of file diff --git a/DEV1.1/TP05:Boucles/table.c b/DEV1.1/TP05:Boucles/table.c new file mode 100644 index 0000000..0f46170 --- /dev/null +++ b/DEV1.1/TP05:Boucles/table.c @@ -0,0 +1,12 @@ +#include + +int main() { + int n; + int i; + printf("Veuillez saisir un entier: "); + scanf("%d",&n); + for (i=1;i<=10;i++){ + printf("%d x %2d = %5d\n",n,i,i*n); //%2d permet l'alignement en colonnes en rajoutant des espaces si nécessaire au nombre de caractères saisient. + } +return 0; +} \ No newline at end of file