61 lines
1.4 KiB
C
61 lines
1.4 KiB
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
|
||
|
/*int main(void){
|
||
|
int x = 0;
|
||
|
int y = 0;
|
||
|
int difference = 0;
|
||
|
int i;
|
||
|
|
||
|
printf ("donnner deux entier pour realiser la sequence : \n");
|
||
|
scanf("%d", &x);
|
||
|
scanf("%d", &y);
|
||
|
|
||
|
|
||
|
if(x > y){
|
||
|
difference = x - y;
|
||
|
for (i = 0 ; i <difference; i++){
|
||
|
y = y + 1;
|
||
|
printf("sequence: %d\n", y);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
if(x < y){
|
||
|
difference = y - x;
|
||
|
for (i = 0 ; i <difference; i++){
|
||
|
y = y - 1;
|
||
|
printf("sequence: %d\n", y);
|
||
|
}
|
||
|
}
|
||
|
}*/
|
||
|
|
||
|
int main(void){
|
||
|
int entrer = 0;
|
||
|
int n = 3;
|
||
|
int chance;
|
||
|
int epargne;
|
||
|
int annee = 0;
|
||
|
|
||
|
printf("veulliez renter l'argent que voous souhaitez deposer choisissez entre 1000 et 50000 euro vous aurez 3 chances\n");
|
||
|
|
||
|
for (chance = 0; chance < 3; chance++){
|
||
|
scanf("%d", &entrer);
|
||
|
if (entrer < 1000 || entrer > 50000){
|
||
|
n--;
|
||
|
printf("entrez un nombre en 1000 et 50000 il vous reste : ");
|
||
|
printf("%d", n);
|
||
|
printf(" chance\n");
|
||
|
}else{
|
||
|
for(epargne = 0; epargne < 7; epargne++){
|
||
|
entrer *= 1.07;
|
||
|
annee++;
|
||
|
printf("votre epargne sera de ");
|
||
|
printf("%d", entrer);
|
||
|
printf(" dans ");
|
||
|
printf("%d", annee);
|
||
|
printf("ans\n");
|
||
|
}
|
||
|
return EXIT_SUCCESS;
|
||
|
}
|
||
|
}
|
||
|
}
|