1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| #include<stdio.h>
#include<math.h>
#include <stdlib.h>
float var(float, int, int);
float valremb(float, int, int, int, float);
int main (void)
{
double txinteret, montantemprunt;
double nbremb;
double Max, Min, K, v;
int i, duree, n, y, p, r1, r;
printf("Montant du pret ? \n");
scanf("%lf", &montantemprunt);
printf("Nombre de remboursements annuels ? \n");
scanf("%d", &nbremb);
printf("Sur une durée (en annees)? \n");
scanf("%d", &duree);
do {
if (r1<r)
{
}
else{
}
}
}while (abs(r1-r)<(1./100));
}
float var (float i, int n, int y)
{
float v;
v = pow((1+i/n),(n*y));
return v;
}
float valremb (float i, int n, int y, int p, float v)
{
v = var(i,n,y);
float r;
r = (i*p*v)/(n*(v - 1));
return r;
} |
Partager