Compare commits
2 Commits
695024c025
...
c58a81f6d6
Author | SHA1 | Date | |
---|---|---|---|
|
c58a81f6d6 | ||
|
8b82af958b |
1
DEV1.1/DEV
Submodule
1
DEV1.1/DEV
Submodule
Submodule DEV1.1/DEV added at 2946df4c38
29
DEV1.1/TP05/tp5.c
Normal file
29
DEV1.1/TP05/tp5.c
Normal file
@@ -0,0 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
/*EXO
|
||||
|
||||
int main(void) {
|
||||
int n;
|
||||
double x;
|
||||
char v;
|
||||
printf("Saisir un réel");
|
||||
n = scanf("%lf\n",&x);
|
||||
v = getchar();
|
||||
printf("Sa forme scientifque : %e\n",n);
|
||||
printf("5 fois de suites ; %c,%c,%c,%c,%c",v);
|
||||
return EXIT_SUCCESS;
|
||||
}*/
|
||||
|
||||
int main(void){
|
||||
int epargne;
|
||||
double x;
|
||||
printf("Combien veux-tu investir : ");
|
||||
epargne = scanf("%lf",&x);
|
||||
printf("après 1 an : %9.4f\n",epargne + 0.04);
|
||||
printf("après 2 ans: %9.4f\n",epargne + (0.04*2));
|
||||
printf("après 3 ans: %9.4f\n",epargne + (0.04*3));
|
||||
printf("après 4 ans: %9.4f\n",epargne + (0.04*4));
|
||||
printf("après 5 ans: %9.4f\n",epargne + (0.04*5));
|
||||
return EXIT_SUCCESS;
|
||||
}
|
27
DEV1.1/TP06/exo1.c
Normal file
27
DEV1.1/TP06/exo1.c
Normal file
@@ -0,0 +1,27 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
/* il se passe que lors du premier if x vaut 2 donc le programme prinf: x vaut 2
|
||||
et dans le second if x=0 ce qui vaut faut donc le programme print: x different de 0*/
|
||||
|
||||
printf("%d\n", x);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
18
DEV1.1/TP06/exo2.c
Normal file
18
DEV1.1/TP06/exo2.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void){
|
||||
int n;
|
||||
int err;
|
||||
|
||||
printf("Entrer un entier naturel ");
|
||||
err= scanf("%d",&n);
|
||||
if ((n%3)<=1) {
|
||||
printf("le multiple le plus proche est : %d\n", (n /3)*3);
|
||||
} else {
|
||||
printf("%d\n",(n/3+1)*3);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user