Skip to main content

Print even number up to 10 using while loop in JAVA

CODING:
class Even
{
 public static void main(String[] args)
  {
   int a=0;
    while(a<=10)
     {
      System.out.println(a);
      a+=2;
     }
  }
}

Comments