#include // for cout and cin #include // for rand() and srand() #include // for time() #include // for getch() using namespace std; // for cout and cin int main() { cout << "Random with no seed" << endl; cout << rand() << endl; cout << rand() << endl; cout << rand() << endl; // getch(); // return 0; cout << endl << "Random with seed" << endl; int seed = time(0); srand(seed); cout << rand() << endl; cout << rand() << endl; cout << rand() << endl; // getch(); // return 0; cout << endl << "RAND_MAX == " << RAND_MAX << endl; // getch(); // return 0; cout << endl << "Random Number Within Range 100" << endl; int range = 100; int randomNumber = 1 + rand() % range; cout << randomNumber << endl; getch(); // return 0; }