Menu

Read two numbers from the user and Display even numbers in the range- Java Program

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

Scanner sc= new Scanner(System.in);
System.out.print("Enter the starting number");
int start = sc.nextInt();
System.out.print("Enter the ending number to print even numbers :");
int end = sc.nextInt();

for(int i=start; i<=end;i++)
{
if(i%2==0)                      System.out.print(i+"\t");

}
}}