Write a java program to for even number.



import java.util.Scanner;
class even
{
public static void main(String args[])
{

System.out.println("Enter no(Grater than 100):");
Scanner sd =new Scanner(System.in);
int h=sd.nextInt();
System.out.println("Even no 100 to " + h);
for(int k=100;k<h;k++)
                {
                if((k%2) == 0)
                                System.out.println(k);
                }
}
}


No comments:

Post a Comment