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 0000000..0169f1e Binary files /dev/null and b/DEV1.1/TP02:Caracteres,Reels/.nfs000000000046254e00000025 differ diff --git a/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 b/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 new file mode 100755 index 0000000..b1f7fee Binary files /dev/null and b/DEV1.1/TP02:Caracteres,Reels/.nfs0000000000462b9000000026 differ 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