diff --git a/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 b/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 deleted file mode 100755 index 29d9c02..0000000 Binary files a/DEV1.1/TP04:Types/.nfs00000000005e220a00000065 and /dev/null differ diff --git a/DEV1.1/TP05:Boucles/division.c b/DEV1.1/TP05:Boucles/division.c new file mode 100644 index 0000000..021718e --- /dev/null +++ b/DEV1.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