Computer Science, asked by pallavi1967, 6 months ago

write a program to print the table of 5 in java​

Answers

Answered by LekshmiSREEKANTH
2

Explanation:

Menu

Java Program to Print Multiplication Table for any Number

« PrevNext »

This is a Java Program to Print Multiplication Table for any Number.

Enter any integer number as input of which you want multiplication table. After that we use for loop from one to ten to generate multiplication of that number.

Here is the source code of the Java Program to Print Multiplication Table for any Number. The Java program is successfully compiled and run on a Windows system. The program output is also shown below.

advertisement

import java.util.Scanner;

public class Multiplication_Table

{

public static void main(String[] args)

{

Scanner s = new Scanner(System.in);

System.out.print("Enter number:");

int n=s.nextInt();

for(int i=1; i <= 10; i++)

{

System.out.println(n+" * "+i+" = "+n*i);

}

}

Similar questions