// demonstrates usage of random function
// Mikhail Nesterenko
// 9/16/2009

#include <iostream>
#include <ctime>
#include <cstdlib>

using namespace std;

int main(){
srand(time(NULL)); // giving random number generator
// unpredictable seed
// srand(1); // giving predictable seed

cout << "Printing random numbers between 0 and "
<< RAND_MAX << endl;
char answer;
do{
cout << "Random number is: " << rand() << endl;
cout << "Another? [y/n] ";
cin >> answer;
}while(answer == 'y');
}