0
how can i write given number table using frame in java
suppose we write table of 2 like 2×1=1 2×2=4 etc so
2 Respostas
0
what do you mean by "using frame"?
0
for(int a=1;a<=10; a++){
System.out.println("2 × " + a + "=" + (2*a));
}
This would do the trick. If you want table of any number, use Scanner to get input and then the same code as above but replace last line by
System.out.println(b + " × " + a + "=" + (b*a));
where b is the variable that stores input.