Multiplication tables program in java

Java code to print the multiplication table




import java.io.*;

class Test {
     public static void main(String[] args) throws IOException {
          int r,i,j,k;
          System.out.println("Enter the range:");
          BufferedReader br=new BufferedReader(new InputStreamReader (System.in));
          r=Integer.parseInt(br.readLine());
         
          for(i=1;i<=r;i++){
              for(j=1;j<=10;j++)
                   System.out.println(i+"*" +j+"="+i*j);
              System.out.print("\n");
          }
         
     }

No comments: