Continue and break – CSKC
Sign In

Search

Code Learning #CPP#7620    siteicon   siteicon  

Continue and break

Source Code

TC++ #7620

Source Code

×

Ask AI About This Code

Default Prompt that is passed along with the code is given below, You can write your own prompt if you so desire.



×

Test CPP

Code Understanding

This program prints all odd numbers from 1 to 20 using a for loop with the continue statement.
• for(int i = 1; i <= 20; i++) → loops from 1 to 20.
• if(i % 2 == 0) continue; → skips the current iteration if i is even.
• cout << i << " "; → prints the number if it is not skipped.


Share

Created: 1-Mar-2026 16:59 | Updated: 1-Mar-2026 17:17|