- #1
Anantharaman
- 2
- 0
#include<iostream.h>
#include<math.h>
#include<conio.h>
void main()
{
int n,fact();
float LAM, MU=3, RO, C=0.1, N=10, F1=0, EXX, EWQ;
clrscr();
for (LAM=0.1;LAM<=1.1;LAM=LAM+0.1)
{
RO=LAM/MU;
EXX=2/(MU*MU);
for(n=1;n<N-1;n=n+1)
F1=F1+(N-n)*pow(LAM*C,n-1)*exp(-LAM*C)/fact(n-1);
EWQ=((N-1)/(2*LAM))+((LAM*EXX)/(2*(1-RO)))-F1;
cout<<"RAO"<<RO<<"EWq"<<EWQ;
}
getch();
}
int fact()
{
int k;
if(k>1)
{
k=k*fact(k-1);
return(k);
}
else
return(1);
}
#include<math.h>
#include<conio.h>
void main()
{
int n,fact();
float LAM, MU=3, RO, C=0.1, N=10, F1=0, EXX, EWQ;
clrscr();
for (LAM=0.1;LAM<=1.1;LAM=LAM+0.1)
{
RO=LAM/MU;
EXX=2/(MU*MU);
for(n=1;n<N-1;n=n+1)
F1=F1+(N-n)*pow(LAM*C,n-1)*exp(-LAM*C)/fact(n-1);
EWQ=((N-1)/(2*LAM))+((LAM*EXX)/(2*(1-RO)))-F1;
cout<<"RAO"<<RO<<"EWq"<<EWQ;
}
getch();
}
int fact()
{
int k;
if(k>1)
{
k=k*fact(k-1);
return(k);
}
else
return(1);
}