We are printing the multiplication table using java
This is a simple program which print the multiplication of the number form 1 to 10
package com.ritesh;
import java.util.Scanner;
public class factorial {
static void mul(long n)
{
for(int i=1;i<=10;i++)
{
long num;
num=n*i;
System.out.printf("%d X %d = %d \n",n,i,num);
}
}
public static void main(String[] args) {
mul(12);
}
}
Comments
Post a Comment