how to generate random numbers of the same at each time of execution of thm
dear friends
i am facing a problem that the random numbers generated at time of each exectuion of the program are not the same, i want to generate the same random numbers every time time i run the program. i need your help. i am giving the code in c++ if anybody can help in providing the solution so that i get the same random numbers at every run of the program. waiting for your help
wit regards
jaya shankar
#include<iostream.h>
#include<stdio.h>
#include<stdlib.h>
#include<time.h>
#include<math.h>
class density
{
int s[150][150],parent[150][150],i,j,l,n,loop;
public:
void bd(void);
void css(void);
};
void density :: bd(void)
{
cout<<"ENTER THE POPULATION SIZE = ";
cin>>n;
cout<<"\nENTER THE NO.OF LOOPS = ";
cin>>loop;
for(i=0;i<n;i++)
for(j=0;j<80;j++)
{
s[j]=rand()%2;
cout><<"s:"<<s[j];
}
}
void density :: css(void)
{
int a,b;
float c;
for(i=0;i<n;i=i+2)
{
b=rand()%100;
cout><<"random b="<<b;
}
}
main()
{
density d;
d.bd();
d.css();
}
>

