The question is as follows: Write a function that prompts the user to enter a series of positive integers, terminated by the value -1. The function must then return the maximum and minimum values entered by the user. You can assume that the user enters at least one positive integer before entering -1.
So what I thought was to create an array to store all the values entered. The only problem is that I'm not quite sure how to declare an array with unknown number of entries since obviously I would not know how many integers the user will enter before -1.
Then for the latter part, I was thinking to make maximum/minimum=arr[0], and then index++, once arr[index]>maximum or arr[index]
Thank you!