50. JAVA Program To Display Multiplication Table for the given Number.
How does this program work?
- Program helps to display Multiplication table using java.
Here is the code
// Multiplication table.
import java.util.Scanner;public class Table
{
public static void main(String args[])
{
int t,i;
System.out.println("Enter a table number:: ");
Scanner obj=new Scanner(System.in);
t = obj.nextInt();
for( i=1; i <= 20; i++)
{
System.out.println(""+t+" X "+i+" = "+(t*i));
}
}
}