Java
public class Main {
public static void main(String[] args) {
for (int i = 2; i <= 100; i += 2) {
System.out.print(i + " ");
}
}
}Output
2 4 6 ... 100
We start from 2 and increment by 2 to hit only even numbers.