An infinite loop is a loop that never exits. If the loop condition cannot possibly be false the loop became infinite. The 'break' keyword is used to exit the current loop.

Exit loop correctly using break.