Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MultiplicationTableWithoutStringBuilder {
- public static void main(String[] args) {
- System.out.print(" |");
- for (int i = 1; i < 10; i++) System.out.print(" " + i);
- System.out.println();
- for (int i = 0; i < 3 * 9 + 2; i++) System.out.print("-");
- System.out.println();
- for (int i = 1; i < 10; i++) {
- System.out.print("" + i + "|");
- for (int j = 1; j < 10; j++) {
- int mul = i * j;
- if (mul < 10)
- System.out.print(" " + mul);
- else
- System.out.print(" " + mul);
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement