Adding elements to array according to the number entered

I have an 8 element array. If the number of entries is greater than the length of the array, I want to add elements to the list as many as the remaining items.
Example: My array length is 8 and ı wrote to the input 15. in this case how can ı add 7 items to the list?

What have you tried so far? What code have you written?

You can push to the array and decrement your entry count.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.