#include <iostream.h>
#include <stdlib.h>
#include <time.h>
int main() {
int i;
time_t t;
// seed the random
srand((unsigned)time (&t));
// srand sets a random seed
// equivalent to srand( time (0) );
cout << "ten random numbers from 0 to 99:\n\n";
for (i = 0; i < 10; i++) {
cout << rand() % 100 << endl;
}
return 0;
}
// cout << rand() % 6 + 1 << endl;
// goes from 1 -> 6
// without the " + 1 " goes from 0 to 5
// the number after the modulus is the number of choices we want to return
return to top