+ 1
how to code multiplication table?
forloop inside the forloop the output is like this 1 2 3 4 5 6 7 8 9 10 2 4 6 8 10 12 14 16 18 20 until 10 and 100
4 Réponses
0
Dead easy question.... using for loop ..for(i=1;i<=10;i++) {
int a; //user input k bro;
SYSTEM.OUT.PRINTLN( "a*"+a+"i"+I+"="+(a*i));}
for n numbers of input
0
import java.util.Scanner;
public class Program
{
public static void main(String[] args) {
int n,i;
Scanner scan=new Scanner(System.in);
System.out.println("Enter number of which you want table");
n=scan.nextInt();
for(i=1;i<=10;i++)
{
System.out.println(n+"*"+i+"="+(n*i));
}
}
}
0
public class Program
{
public static void main(String[] args)
{
int i,j;
for(i=1;i<=10;i++)
{
for(j=1;j<=10;j++)
{
System.out.print(" " + i*j);
}
System.out.println();
}
}
}
0
How to convert it using while loop