You are on page 1of 1

Practical 5…2

public class forIf{

public static void main(String args[]){

System.out.println("Even numbers till 20 are:");

for(int i=0;i<=20;i++){

if(i%2==0){

System.out.println(i);

Output

Even numbers till 20 are:

10

12

14

16

18

20

You might also like