Question: My program doesn't know how many input values a user will enter (and can't ask how many), so an array can't hold all of them.
My program doesn't know how many input values a user will enter (and can't ask how many), so an array can't hold all of them. I have an array of 10 integers. write the input to a slot and increment it if it's not -1. If incrementing the value puts it beyond the end of the array, set the index of array back to the first slot. If the user input is more than 10 inputs, print only the last 10 inputs. If the amount of inputs is less than ten, and the user types -1, exit the program and output all of those numbers(not -1 though).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
