Skip to content

Instantly share code, notes, and snippets.

@olegrewko
Created April 24, 2020 12:18
Show Gist options
  • Save olegrewko/44dfd522700060a42595153624e8c353 to your computer and use it in GitHub Desktop.
Save olegrewko/44dfd522700060a42595153624e8c353 to your computer and use it in GitHub Desktop.
TableB
package IgorDolgov;
public class TableB {
public static void main (String[] args) {
multiline(2, 6);
System.out.println("-----------------------------------------------------------");
multiline(6, 10);
}
public static void multiline (int from, int to) {
for (int i = 1; i < 10; i++) {
String s = " ";
for (int j = from; j < to; j++) {
s += (Integer.toString(j) + " * " + Integer.toString(i) + " = " + Integer.toString(i * j) + "\t\t");
}
System.out.println(s);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment