Thursday, October 20, 2011

Poisson distribution implementation


void poisson()
{
int x;
double a;
printf("poisson distribution implementation:\n");
printf("enter x & a:");
scanf("%d%lf",&x,&a);
if(x>0)
printf("pmf=%.3lf",(exp(-a)*pow(a,x))/fact(x));
}

No comments:

Post a Comment