Wap to generate multiplication table in java
import java.util.*;
class multiplicationtable
{
public static void main(String args[])
{
int i,n;//local variable
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
n=sc.nextInt();
for(i=1;i<=10;i++)
{
System.out.println(n+"*"+i+"="+n*i);
}
}
}
class multiplicationtable
{
public static void main(String args[])
{
int i,n;//local variable
Scanner sc=new Scanner(System.in);
System.out.println("Enter the number");
n=sc.nextInt();
for(i=1;i<=10;i++)
{
System.out.println(n+"*"+i+"="+n*i);
}
}
}
Comments
Post a Comment