Tuesday, 10 October 2017

Java program print even number table


import java.util.*;
public class EvenTabble
{
 public static void main(String args[])
{
  Scanner p= new Scanner(System.in);
 int num,limit;
  System.out.println("Enter the table number please :");
  num=p.nextInt();
 System.out.println("Enter the limit of table please ");
  limit=p.nextInt();
 for(int i=1;i<=limit;i++)
{
 if(i%2==0)
 System.out.println(num+" x "+i+" = "+(num*i));
}}}

0 comments:

Post a Comment