Q:

Write a Java program to display the multiplication table of a given integer

0

Write a Java program to display the multiplication table of a given integer

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

In this demo I have used NetBeans IDE 8.2 for debugging purpose. But you can use any java programming language compiler as per your availability..

import java.util.Scanner;
public class JavaExcercise {
 
   public static void main(String[] args)
 
{
   int j,num;
{
   System.out.print("Enter number of terms : ");
    Scanner in = new Scanner(System.in);
            num = in.nextInt();
 
   System.out.println ("\n");
   for(j=0;j<=num;j++)
 
     System.out.println(num+" X "+j+" = " +num*j);
   }
}
}

Result:

Enter number of terms : 10

10 X 0 = 0

10 X 1 = 10

10 X 2 = 20

10 X 3 = 30

10 X 4 = 40

10 X 5 = 50

10 X 6 = 60

10 X 7 = 70

10 X 8 = 8010 X 9 = 90

10 X 10 = 100

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Write a Java program that reads an integer and che... >>
<< Write a Java program to display the n terms of odd...