Random by time : Random « Development « C++
- C++
- Development
- Random
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;
}
}
Related examples in the same category