Consider a program that is supposed to have an array holding few integers. The program asks the user to enter a number. The program is supposed to go through the array and look for the number entered by the user. If its not in the array, use a cout statement to say that the number is invalid. And vice versa. I could use a general outline.
Instead of writing your own for loop take a look at this info on the std::find algorithm. You can easily use some parts of the example in order to build your program. The example does a good job of explaining the concept. http://cplusplus.com/reference/algorithm/find/