rand()
or
srand()
functions...
EX:
#include<stdlib.h>
#include<iostream.h>
#include<time.h>
void main()
{
#include<stdlib.h>
#include<iostream.h>
#include<time.h>
void main()
{
int i, randnum;
unsigned int seedval;
time_t t;
seedval=(unsigned) time (&t); // time (&t) function will initialize time variable with system time.
for(i=0;i<5;++i)
cout<<rand()<<endl;
}
Just put codes of your own along with this ...
This post has been edited by anujsharma002: 20 December 2011 - 02:52 AM

New Topic/Question
Reply





MultiQuote






|