Even number series || Java Programs || Java

In this, we are going to write a  program to print the 2, 4, 6, 8, 10, … , 100 in series in Java.
class Series1 
{
    public static void main(String[] args) 
    {
        int i;
        for (i = 2; i <= 100; i += 2) 
        {
            System.out.print(i + " ");
        }
    }
}
#ENJOY CODING

Post a Comment

FOR ANY DOUBTS AND ERRORS FEEL FREE TO ASK. YOUR DOUBTS WILL BE ADDRESSED ASAP

Previous Post Next Post