Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started