[Java] Multiplication Table Java Program


This Java program is for print Multiplication table of Input Number.

import java.util.Scanner;

class MultiplicationTable
{
public static void main(String args[])
{
int n, c;
System.out.println("Enter an integer value to display it's multiplication table");
Scanner in = new Scanner(System.in);
n = in.nextInt();
System.out.println("Multiplication table of "+n+" is :-");

for ( c = 1 ; c <= 10 ; c++ )
System.out.println(n+"*"+c+" = "+(n*c));
}
}

Output

Enter an integer value to display it's multiplication table

13
Multiplication table of 13 is :-
13*1 = 13
13*2 = 26
13*3 = 39
13*4 = 52
13*5 = 65
13*6 = 78
13*7 = 91
13*8 = 104
13*9 = 117
13*10 = 130

More

For more Algorithms and Java Programing Test questions and sample code follow below links

 

Advertisement

One thought on “[Java] Multiplication Table Java Program”

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s