Java Program to N th Multiplication table till M

Get input n and m, print the multiplication table of n till m

Sample Input 1:

4 7

Sample output 1:

1X4=4

2X4=8

3X4=12

4X4=16

5X4=20

6X4=24

7X4=28

Program or Solution

				
			
					
// To Find The Multiplication Of N Till The M rows...

import java.util.*;

class Program
{
  public static void main(String args[])
  {
      int table,times,i,result;
      Scanner sc=new Scanner(System.in);

     System.out.println("Enter The Table:");
     table=sc.nextInt();

      System.out.println("Enter The Times:");
      times=sc.nextInt();

      System.out.println("The Output Is:");
      for(i=1;i<=times;i++)
      {
            result=table*i;
            System.out.println(" "+result);
     }

  }
}
			
				
			

Program Explanation