Header Ads

JAVA Program to print Multiplication Table



Write a JAVA Program to print Multiplication Table  

Program/Code:


import java.util.Scanner;
class Tables{
     public static void main(String args[]){
          int i,f,t,c;
          System.out.print("Enter a range to print Multiplication ");
          Scanner input=new Scanner(System.in);
          f=input.nextInt();
          t=input.nextInt();
           for(c=f;c<=t;c++){
               System.out.println("The multiplication of "+c+" is");
               for(i=1;i<=10;i++){
              System.out.println(c+"*"+i+"="+(c*i));
                    }
               }
          }
     }


Output:

No comments:

Your comment will be visible after review.