Professional Documents
Culture Documents
Handoff Po
Handoff Po
#includeconio.h~
#includestdio.h~
#includemath.h~
long Iactorial(int);
void main()
Iloat d,l,e,Iin,lam,x,y,dist|12|,pr,d1,z0,tp;
int number,i,ct0,gt0;
long Iactorial1;
clrscr();
printI("\n\t\t $IMULATION OF HANDOFF\n");
Ior(i1;i2;i)
printI("\n Enter time instance to Iind traIIic:");
scanI("d",&number);
Iactorial1Iactorial(number);
printI("\n Enter wavelength:");
scanI("I",&l);
dexp(-l);
epow(l,number);
Iin (d*e)/Iactorial1;
printI("\n Poison distribution Ior traIIic in cell d : I ",i,Iin*100);
}
Ior(i1;i5;i)
printI("\n Enter distance oI userd:",i);
scanI("I",&dist|i|);
}
lam500;
z(4*3.14*12);
tppow(lam/z,2);
printI("\n The threshold power is: I",tp);
Ior(i1;i5;i)
x(4*3.14*dist|i|);
ylam/x;
pry*y;
printI("\n The received power oI userd: I",i,pr);
iI(prtp)
ct;
printI("\nUser d is considered hand oII user\n",i);
getch();
}
else
gt;
printI("\nUserd is not a hand oII user\n",i);
getch();
}
}
printI("\n\n No oI users in hand oII:d",ct);
printI("\n\n No oI users not in handoII:d",gt);
getch();
}
long Iactorial(int n)
int c;
long result 1;
Ior( c 1 ; c n ; c )
result result*c;
return ( result );
}
$IMULATION OF HANDOFF
No oI users in handoII: 3