## JAVA program to print Multiplication Table

Today we shall program another simple and basic problem.In our childhood many of us find difficulty in learning the Multiplication tables.Now, we shall take revenge on them by writing the program.Let us consider that our program takes two values as inputs which are,one for the number of tables required starting from 1 and other for limit of the multiplication…i.e either upto 10 or 20.Here we need two for loops,one for iteration of table and other for the multiplication of the table.Let us know write the code for it.

```import java.util.*;
class tables
{
void calculation(int n,int limit)
{
for(int i=1;i&lt;=n;i++)
{
System.out.println(&quot;***************Multiplication Table of &quot; + i +&quot; is ******************&quot;);
for(int j=1;j&lt;=limit;j++)
{
System.out.println(i + &quot; * &quot; + j +&quot; = &quot;+(i*j));
}
}
}
}
class multiptables
{
public static void main(String arg[])
{
Scanner in = new Scanner(System.in);
System.out.println(&quot;Enter number of tables required starting from 1:&quot;);
int n = in.nextInt();
System.out.println(&quot;Enter limit of the tables to be multiplied:&quot;);
int limit = in.nextInt();
tables ob = new tables();
ob.calculation(n,limit);
}
}```

Explanation:In the main function we are getting the input from the user regarding number of tables and limit of the multiplication.Then we are invoking the function calculation by passing those inputs and printing the table.
The output of the above program is:  