Tables Printing in Java Programs

Tables are Mathematical listed down numbers which showing the results with calculated series Rows and Column.
Num * 1 = SNum
upto
Num * 10 = SNum or Num * 20 = SNum

example: 2*5=10 which means 2 number multiple by 5 which is equals to 10 and if 2 number is added 5 times its also calculated 10.

import java.util.Scanner;
class Table
{
public static void main(String[] args)
{
Scanner read=new Scanner(System.in);
System.out.print("Enter Table to Print:=  ");
int num = read.nextInt();
System.out.println("-------------------------");
for(int i=1;i<=10;i++)
{
int SNum=num*i;
System.out.println(num + " * "+ i +" = "+ SNum);
}
}
}

(Visited 115 times, 1 visits today)
Share with Friends :
Written by:

One thought on “Tables in JAVA

  • 02/08/2018 at 5:55 am
    Permalink

    Great article. Good to understand for everyone.

    Reply

Leave a Reply

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