#include"stdio.h"
#include"stdlib.h"
#include"math.h"
int t_rand(int a)
{
int m;
m=rand()%10;
m=m%a;
if(m==0)
m=1;
return m;
}
void main()
{
int o_rate,bufsize,i,maxtime,presentsize=0,rate;
clrscr();
printf("enter the buffer size,output rate and max time for transaction");
scanf("%d%d",&bufsize,&o_rate);
rate=o_rate;
maxtime=t_rand(4)*10;
for(i=0;i
o_rate=presentsize;
presentsize-=o_rate;
printf("the present size of bucket is %d after removing %d bytes\n\n",presentsize,o_rate);
}
getch();
}
This entry was posted
at 10:26 AM
and is filed under
Networks-programs
. You can follow any responses to this entry through the
comments feed
.