public class Demo { public static void main(String[] args){ int x; for(x=1;x<=20;x++) { if(x%2==0) { System.out.println(x); } } } }
2 4 6 8 10 12 14 16 18 20
Apply For Job
Java Material
Python Material
PLSQL Material
.Net Material
Write a Java program to swap the first and last elements of an array and create a new array
Write a Java program to print ‘Hello World!’ on screen
Write a Java program to convert a string to an integer
Write a Java program to print the even numbers from 1 to 20
Write a Java program to print the sum of two numbers