Writing a program with array

I need to write and array that generates random integers and stores them in an array and the user enters the number of integers to generate and their range of values, but I'm clueless. I have no idea on how to create an array.

Here's an example of how it should look after.. the user input is the 20, -10, and 50

Enter the number of values to generate: 20
Enter the lower bound: -10
Enter the upper bound: 50

The values generated are:
37 35 44 2 11 9 -10 35 -10 45 45 30 38 29 -4 37 31 48 39 11

Maximum value: 48
Minimum value: -10

Negative values: 3

Any Zeros: No


Any help would be greatly appreciated.
Last edited on
1
2
3
4
5
int *arr = new int[NUMBER];
...
//Fill array, do whatever
...
delete[] arr;

Just replace NUMBER with however many you want to create (which can also be a variable that stores how many you need to create).
Topic archived. No new replies allowed.