Continue & break
Working on break and continues and the try it yourself wants me to skip odd numbers that are being input and ive tried a hundred different ways and can only skip the 1st number when i try to modify the code in the example i can get it to skip the odds but not in try it yourself. This is my most recent attempt If you can help as well as explain the answer thatd be appreciated using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace SoloLearn { class Program { static void Main(string[] args) { int amount = Convert.ToInt32(Console.ReadLine()); int count = 0; int totalAmount = 0; while (count<amount) { count++; int price = Convert.ToInt32(Console.ReadLine()); /* starts me after price input line and states to skip odd numbers*/ for (;price < 10; price++) if (++price == 1) continue; totalAmount += price; } Console.WriteLine(totalAmount); } } }