I'm using poisson's process for probability. This is the equation I'm using : P(x)= ((lamda^x)*e^(-lamba))/x!

it's the factorial part I'm not getting right though. I can get the first 3 probabilities right (0,1,2) but everything after that starts to be off by half and so on. Look I know the code isn't perfect by any means and I'm missing some things, but this is the meat and where the problem lies. I'm new to this so please help me out.

```
for (x = 0.0; x <= 10.0; x = x + 1.0) // three control expressions of the loop
{
for(i=x;i>=1;i--)
{
fact=fact*i;}
b=pow(a,x);
c=pow(2.71828, -a);
d=b*c;
e=d/fact;
```