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

Introduction

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

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

Leave a Comment