Write a java method to print multiplication table of a number n.

public class mul{
    
    static void mult(int x){
    for (int i=1; i<=10; i++){
    System.out.format ("%d X %d =%d\n",x,i,x*i);
    }}


    public static void main (String args[]){
    
    mult(3);

} }

Comments

Popular posts from this blog

Create an array of 5 floats and calculate their sum in java .