#include
#include
#include
double f(int x, double v, double a, double b)
{
if(x< v)
return 0;
else
{
return b/a*(pow((x-v)/a,b-1))*exp(-pow((x-v)/a,b));
}
}
double F(int x, double v, double a, double b)
{
if(x
else
{
return (1 - exp(-pow((x-v)/a,b)));
}
}
int main()
{
int x;
double v,a,b;
clrscr();
printf("enter d value of x, location, shape & scale: ");
scanf(" %d %lf %lf %lf",&x, &v, &b, &a);
printf(" f(%d) = %f",x,f(x,v,a,b));
printf(" F(%d) = %f",x,F(x,v,a,b));
getch();
return 0;
}
No comments:
Post a Comment