20 lines
437 B
C
20 lines
437 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
int main(void) {
|
||
|
double f;
|
||
|
int i;
|
||
|
printf("Combien d'euros voulez-vous investir ? ");
|
||
|
scanf("%lf", &f);
|
||
|
while(f < 1000 || f > 50000){
|
||
|
printf("Erreur! Veuillez réessayer\n");
|
||
|
printf("Combien d'euros voulez-vous investir ? ");
|
||
|
scanf("%lf", &f);
|
||
|
}
|
||
|
printf("Annee 0 : %9.2f\n", f);
|
||
|
for (i = 1 ; i<=7 ; i++){
|
||
|
f = f * 1.04;
|
||
|
printf("Annee %d : %9.2f\n", i, f);
|
||
|
}
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|