var x = 0; var y = 0; while (x < 100) { x+=1; if(x % 2) // only odd numbers { continue; // loop continuing from the start } y += x; // all odd numbers up to 100 will be sum }
See also: