I have an Array where 10 people eats pancakes. I want to stop the input when the last person have eaten but it needs Another input to stop the loop and I cant figure it out.
Try moving the cin >> input on line 18 to the first line inside the loop and eliminate lines 25-29. You can put your thank you message immediately after the while loop.
I see no need for the variable numOfElements. As it now stands it will always be the same as PERSONS when the while loop completes, so you can just use PERSONS in your for loop condition on line 32 instead of numOfElements.