DEV/DEV1.1/TP02/interets.c

31 lines
795 B
C

#include <stdio.h>
#include <stdlib.h>
int main(void){
double n=0;
int annee=1;
printf("saisir la somme a investir: ");
scanf("%lf",&n);
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
n= n + (n*0.04);
printf("somme au bout de %d annee(s): %9.4f \n", annee, n);
annee+=1;
return EXIT_SUCCESS;
}