C++ - Break / Continue
Overview
Estimated time: 15–25 minutes
Exit loops early with break or skip to the next iteration with continue.
Learning Objectives
- Use break and continue safely.
Prerequisites
Examples
for (int i=0;i<10;++i){ if (i==3) break; }
for (int i=0;i<5;++i){ if (i%2==0) continue; }