Hello,
How can i break a for/while loop when the user enters a specific string?

In the main function, I ask the user to enter 10 strings and the programm should stop when the user enters for example the word 'apple'