You are on page 1of 2

#include <stdio.

h>
#include <stdlib.h>
#include <math.h>

float calculaP0(float lambida, float mi)


{
float somaPG, P0;
somaPG= (lambida/mi)/(1-(lambida/mi));
printf("soma = %f",somaPG);
P0= 1/(1+ somaPG);
printf("Po = %f",P0);
return P0;
}

float calculaTodas(int j, float P0, float lambida, float mi)


{
int i;
float Pj,exp;
Pj=0;
for(i=0; i<=j; i++)
{
exp=pow(lambida/mi,i);
Pj=P0*exp;
printf("P%d = %f\n ",i, Pj);
}
}

int main()
{
float P0;
P0 = calculaP0(20,24);
calculaTodas(40,P0,20, 24);
return 0;
}

You might also like