Continue Statement Behavior
📖 Scenario: Imagine you are checking a list of daily temperatures to find which days were warm enough to go outside. You want to skip cold days and only note the warm days.
🎯 Goal: You will write a program that uses the continue statement to skip cold days and print only the warm days from a list of temperatures.
📋 What You'll Learn
Create an integer array called
temperatures with the exact values: 15, 22, 8, 30, 12Create an integer variable called
warmThreshold and set it to 20Use a
for loop with the variable i to iterate over temperaturesInside the loop, use an
if statement to continue when the temperature is less than warmThresholdPrint the warm temperatures only using
Console.WriteLine💡 Why This Matters
🌍 Real World
Skipping unwanted data is common when processing lists, like ignoring cold days when planning outdoor activities.
💼 Career
Understanding how to control loops with <code>continue</code> helps in writing efficient code that processes only needed data.
Progress0 / 4 steps