Java program to find a table of a input number using for loop

import java.util.Scanner;
class scan
{
 public static void main(String arg[])
  { 
   int x,i,y;
   Scanner kb=new Scanner(System.in);
    System.out.println("Enter  Number You Want To Print Table:- ");
	 x=kb.nextInt();
	 for(i=1;i<=10;i++)
	  { 
	   y=x*i;
	   System.out.println(x+" * "+i+" = "+y);
	  }
  }
}

OUTPUT:-

scanfcode

Leave a Reply

Your email address will not be published. Required fields are marked *