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 convert a binary number to decimal number
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 the odd numbers from 1 to 20
Write a Java program and compute the sum of the digits of an integer
Write a Java program to count the number of even and odd elements in a given array