1
2
3
4
5
6
7
8
9
10
11
12
| class MultiplicationTable{
public static void main(String args[]){
int num = Integer.parseInt(args[0]);
System.out.println("*****MULTIPLICATION TABLE*****");
for(int i=1;i<=num;i++){
for(int j=1;j<=num;j++){
System.out.print(" "+i*j+" ");
}
System.out.print("\n");
}
}
} |
class MultiplicationTable{
public static void main(String args[]){
int num = Integer.parseInt(args[0]);
System.out.println("*****MULTIPLICATION TABLE*****");
for(int i=1;i<=num;i++){
for(int j=1;j<=num;j++){
System.out.print(" "+i*j+" ");
}
System.out.print("\n");
}
}
}
thanks
Here the correct code……
import java.util.Scanner;
public class multip{
public static void main(String arg[])
{
int i,k;
Scanner in=new Scanner(System.in);
System.out.println(“Enter the multiplication table number “);
i=in.nextInt();
for(int j=1; j<=10; j++)
{
k=i*j;
System.out.println(i+" * "+j+" = "+k);
}
}
}
i like it
i like
import java.io.*;
class jh
{
public static void main(String args[])throws IOException
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int a,b,c=1;
System.out.println(“Enter The No=”);
a=Integer.parseInt(br.readLine());
for(c=1;c<=10;c++)
{
b=a*c;
System.out.println(b);
}
}
}
sir can u tell me the ex for print multipl table in a programming example