Answer:
// Java solution
for ( int i = 0; i < 101; i++)
{
if ( i % 2 == 0)
{
System.out.println( i + " ");
}
}
Using modulus, whatever number we are currently on in our loop is evaluated to see if it is even. Any number divided by 2 that is even will not have a remainder, hence ==0. So we just print the numbers that satisfy that condition and we have all evens.