Mega Code Archive

 
Categories / C++ / Development
 

Random by time

#include <iostream> #include <ctime> using namespace std; int main( void ) {  int i,j;  srand( (unsigned)time( NULL ) );  /* Display 10 numbers. */  for( i = 0;i < 10;i++ )  {    j= rand();    cout << j << endl;      } }