// random_devcpp.cpp

#include <cstdlib>
#include <iostream>

// Using the Dev-C++ development environment

// Example program showing how to generate a
// series of ten
// random numbers in the range 1 to 5.
// See p965 4th edition textbook, or 
// look up "random number generator" in the
// index of your textbook.

// Last updated: Mon 24th January 2005, 6:20 PT, AHD

using namespace std;

int main()
{
    int seed = 5;
    srand(seed);  // calls up random number generator
    int random_integer, count = 0;
    while (count < 10)
    { 
        count++; // add 1 to count
        random_integer = rand()%seed + 1; // gets random number in range 1 to seed
        cout << random_integer << endl;
    }
    system("PAUSE"); // acts like a getch(); in Borland
    return EXIT_SUCCESS;  // EXIT_SUCCESS is a constant integer
}

