/**** This program generates a series of random numbers and saves them in a file. It uses C's capabilities for random number generation. The user is first prompted for a seed for the random number generator. The numbers are then generated (the quantity of numbers is determined by the constant MaxNum) in the function GenRand. The data are then saved in the function SaveRand, which first prompts the user for a file name. After the name is given the file is opened -- if this causes an error the calling program is notified. If there was no error the data are saved and the file is closed. A NO_ERROR condition is returned to the calling program. Written by Erik Cheever, 1/94 ****/ #include #include // This library contains random number stuff #define MaxNum 100 // Number of random numbers generated #define ERROR -1 // Constants used to signify errors #define NO_ERROR 0 // Generate the random numbers and save in array void GenRand(int *Nums) { int i, randNum; for (i=0; i