Final answer:
To generate different random numbers each time, replace the constant seed value in the srand() function with the current time and adjust the range of the random number to be between 30 and 90.
Step-by-step explanation:
The current program generates the same random number each time because it uses a constant seed value of 997 with the srand() function. To have the program generate a different random number each time, we need to provide a different seed value. The common approach is to use the current time as a seed, which changes every second. Therefore, we should include the time.h header and modify the call to srand() like so: srand((unsigned)time(NULL)). After introducing this change, we can adjust the range of the random numbers to be between 30 and 90 by modifying the assignment to rand1 as follows: rand1 = (rand() % 61) + 30;. The % 61 ensures the number is between 0 and 60, and adding 30 shifts the range to 30-90.