exo6tp5
This commit is contained in:
20
DEV1.1/TP05/tp5exo5.c
Normal file
20
DEV1.1/TP05/tp5exo5.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void){
|
||||
int n;
|
||||
double x;
|
||||
|
||||
printf("Combien veux-tu investir :\n");
|
||||
n = scanf("%lf",&x);
|
||||
printf(" 1 ans : %f\n", x*0.04);
|
||||
printf(" 2 ans : %f\n", x*(0.04*2));
|
||||
printf(" 3 ans : %f\n", x*(0.04*3));
|
||||
printf(" 4 ans : %f\n", x*(0.04*4));
|
||||
printf(" 5 ans : %f\n", x*(0.04*5));
|
||||
printf(" 6 ans : %f\n", x*(0.04*6));
|
||||
printf(" 7 ans : %f\n", x*(0.04*7));
|
||||
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
32
DEV1.1/TP05/tp5exo6.c
Normal file
32
DEV1.1/TP05/tp5exo6.c
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
int main(void){
|
||||
int n1;
|
||||
int n2;
|
||||
int n3;
|
||||
int n4;
|
||||
int n5;
|
||||
|
||||
double x1;
|
||||
double x2;
|
||||
double x3;
|
||||
double x4;
|
||||
double x5;
|
||||
|
||||
printf("Premier réel :\n");
|
||||
n1 = scanf("%lf",&x1);
|
||||
printf("Deuxième réel :\n");
|
||||
n2 = scanf("%lf",&x2);
|
||||
printf("Troisième réel :\n");
|
||||
n3 = scanf("%lf",&x3);
|
||||
printf("Quatrième réel :\n");
|
||||
n4 = scanf("%lf",&x4);
|
||||
printf("Cinquième réel :\n");
|
||||
n5 = scanf("%lf",&x5);
|
||||
|
||||
printf("Somme des réels : %f\n", x1+x2+x3+x4+x5);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
Reference in New Issue
Block a user