Multiplication Pyramid Table
In this program, You will learn to print the Multiplication Pyramid table in Java programming. Example of Multiplication Pyramid table is the following:-
1
2 4
3 6 9
4 8 12 16
Program to Print Multiplication Pyramid table in Java
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | class MultiplicationPyramid { public static void main(String str[]) { label: for(int i=1;i<8;i++) { for(int j=1;j<8;j++) { if(j>i) { System.out.println(); continue label; } System.out.print(" "+i*j); } } System.out.println(); } } |
Output
Check out our other Java Programming Examples