#include<iostream.h>
#include<conio.h>
#include<math.h>
void main()
{
clrscr();
int x0,k,a,m,i,j,random[20],r;
cout<<”Enter your x0 value = “;
cin>>x0;
cout<<endl<<”Enter your K value: = “;
cin>>k;
cout<<endl<<”Enter the value of r>2: = “;
cin>>r;
m=pow(2,r);
a=k*8+3;
for(i=0;i<10;i++)
{
random[i]=(x0*a)%m;
x0=random[i];
}
cout<<”Random numbers are:”<<endl;
for(j=0;j<i;j++)
cout<<random[j]<<endl;
getch();
}
0
Random Number
Leave a Reply
- Page 1 of 1
- « Previous
- 1
- Next »
- Page:
