class Pattern1 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(n + " "); } System.out.println(); } } }
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
class Pattern2 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print((char)(alpha + n -1) + " "); } System.out.println(); } } }
A A B A B C A B C D A B C D E
class Pattern3 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print("* "); } System.out.println(); } } }
* * * * * * * * * * * * * * *
class Pattern4 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(m + " "); } System.out.println(); } } }
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
class Pattern5 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print((char)(alpha + m -1) + " "); } System.out.println(); } } }
A B B C C C D D D D E E E E E
class Pattern6 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print("* "); } System.out.println(); } } }
* * * * * * * * * * * * * * *
class Pattern7 { public static void main(String args[]) { int rows = 5; for (int m = 1; m <= rows; m++) { for (int n = rows; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print(p + " "); } System.out.println(); } } }
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
class Pattern8 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = 1; n < m; n++) { System.out.print(" "); } for (int p = m; p <= r; p++) { System.out.print(p + " "); } System.out.println(); } } }
5 4 5 3 4 5 2 3 4 5 1 2 3 4 5
class Pattern9 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n >= m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print((char) (alpha + p - 1) + " "); } System.out.println(); } } }
A A B A B C A B C D A B C D E
class Pattern10 { public static void main(String args[]) { int alpha = 65; int rows = 5; for (int m = rows; m >= 1; m--) { for (int n = 1; n <= m; n++) { System.out.print(" "); } for (int p = m; p <= 5; p++) { System.out.print((char) (alpha + p - 1) + " "); } System.out.println(); } } }
E D E C D E B C D E A B C D E
class Pattern11 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= (m * 2) - 1; p++) { System.out.print("*"); } System.out.println(); } } }
* *** ***** ******* *********
class Pattern12 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print(m + " "); } System.out.println(); } } }
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
class Pattern13 { public static void main(String[] args) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print((char) (alpha + m - 1) + " "); } System.out.println(); } } }
A B B C C C D D D D E E E E E
class Pattern14 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = 1; n <= m; n++) { System.out.print(n + " "); } System.out.println(); } } }
1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
class Pattern15 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n >= m; n--) { System.out.print(n + " "); } System.out.println(); } } }
5 4 3 2 1 5 4 3 2 5 4 3 5 4 5
class Pattern16 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = r; n >= m; n--) { System.out.print(n + " "); } System.out.println(); } } }
5 5 4 5 4 3 5 4 3 2 5 4 3 2 1
class Pattern17 { public static void main(String args[]) { int r = 5; int t = 1; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(t + " "); t++; } System.out.println(); } } }
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
class Pattern18 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = r; m >= 1; m--) { for (int n = 1; n <= m; n++) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
A B C D E A B C D A B C A B A
class Pattern19 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n >= m; n--) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
E D C B A E D C B E D C E D E
class Pattern20 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = r; m >= 1; m--) { for (int n = r; n >= m; n--) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
E E D E D C E D C B E D C B A
class Pattern21 { public static void main(String args[]) { int alpha = 65; int rows = 5; for (int m = 1; m <= rows; m++) { for (int n = 1; n <= m; n++) { System.out.print((char) (alpha) + " "); alpha++; } System.out.println(); } } }
A B C D E F G H I J K L M N O
class Pattern22 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } int temp = 1; for (int p = 1; p <= m; p++) { System.out.print(temp + " "); temp = temp * (m - p) / (p); } System.out.println(); } } }
1 1 1 1 2 1 1 3 3 1 1 4 6 4 1
class Pattern23 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } int temp = 1; for (int p = 1; p <= m; p++) { System.out.print((char) (alpha - 1 + temp) + " "); temp = temp * (m - p) / (p); } System.out.println(); } } }
A A A A B A A C C A A D F D A
class Pattern24 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(n + " "); } System.out.println(); } for (int m = r; m >= 1; m--) { for (int n = 1; n < m; n++) { System.out.print(n + " "); } System.out.println(); } } }
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
class Pattern25 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } for (int m = r; m >= 1; m--) { for (int n = 1; n <= m - 1; n++) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
A A B A B C A B C D A B C D E A B C D A B C A B A
class Pattern26 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int i = 1; i <= m; i++) { System.out.print("* "); } System.out.println(); } for (int m = 1; m <= r - 1; m++) { for (int i = r - 1; i >= m; i--) { System.out.print("* "); } System.out.println(); } } }
* * * * * * * * * * * * * * * * * * * * * * * * *
class Pattern27 { public static void main(String args[]) { int r = 5; for (int i = 1; i <= r; i++) { for (int j = r; j > i; j--) { System.out.print(" "); } for (int k = 1; k <= i; k++) { System.out.print("*"); } System.out.println(); } for (int i = 1; i <= r - 1; i++) { for (int j = 1; j <= i; j++) { System.out.print(" "); } for (int k = r - 1; k >= i; k--) { System.out.print("*"); } System.out.println(); } } }
* ** *** **** ***** **** *** ** *
class Pattern28 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = 1; n <= m; n++) { System.out.print(n + " "); } System.out.println(); } for (int m = 2; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(n + " "); } System.out.println(); } } }
1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5
class Pattern29 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = m; n >= 1; n--) { System.out.print(n + " "); } System.out.println(); } for (int m = 2; m <= r; m++) { for (int n = m; n >= 1; n--) { System.out.print(n + " "); } System.out.println(); } } }
5 4 3 2 1 4 3 2 1 3 2 1 2 1 1 2 1 3 2 1 4 3 2 1 5 4 3 2 1
class Pattern30 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = r; m >= 1; m--) { for (int n = 1; n <= m; n++) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } for (int m = 2; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
A B C D E A B C D A B C A B A A B A B C A B C D A B C D E
public class Pattern31 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = r; m >= 1; m--) { for (int n = m; n >= 1; n--) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } for (int m = 2; m <= r; m++) { for (int n = m; n >= 1; n--) { System.out.print((char) (alpha + n - 1) + " "); } System.out.println(); } } }
E D C B A D C B A C B A B A A B A C B A D C B A E D C B A
class Pattern32 { public static void main(String args[]) { int r = 5; for (int m = r; m >= 1; m--) { for (int n = m; n >= 1; n--) { System.out.print("* "); } System.out.println(); } for (int m = 2; m <= r; m++) { for (int n = m; n >= 1; n--) { System.out.print("* "); } System.out.println(); } } }
* * * * * * * * * * * * * * * * * * * * * * * * * * * * *
class Pattern33 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int k = 1; k <= m; k++) { System.out.print(k + " "); } for (int l = m - 1; l >= 1; l--) { System.out.print(l + " "); } System.out.println(); } } }
1 1 2 1 1 2 3 2 1 1 2 3 4 3 2 1 1 2 3 4 5 4 3 2 1
class Pattern34 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int k = 1; k <= m; k++) { System.out.print((char) (alpha + k - 1) + " "); } for (int l = m - 1; l >= 1; l--) { System.out.print((char) (alpha + l - 1) + " "); } System.out.println(); } } }
A A B A A B C B A A B C D C B A A B C D E D C B A
class Pattern35 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = 1; n < m; n++) { System.out.print("0 "); } System.out.print(m + " "); for (int p = m; p < r; p++) { System.out.print("0 "); } System.out.println(); } } }
1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 5
class Pattern36 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(1 + " "); } for (int p = 1; p <= m; p++) { System.out.print(m + " "); } System.out.println(); } } }
1 1 1 1 1 1 1 1 2 2 1 1 3 3 3 1 4 4 4 4 5 5 5 5 5
class Pattern37 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print((char) (alpha) + " "); } for (int p = 1; p <= m; p++) { System.out.print((char) (alpha + m - 1) + " "); } System.out.println(); } } }
A A A A A A A A B B A A C C C A D D D D E E E E E
class Pattern38 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print(p + " "); } System.out.println(); } for (int m = 1; m <= r; m++) { for (int n = 1; n <= m; n++) { System.out.print(" "); } for (int p = 1; p <= r - m; p++) { System.out.print(p + " "); } System.out.println(); } } }
1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1
class Pattern39 { public static void main(String args[]) { int alpha = 65; int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n >= m; n--) { System.out.print(" "); } for (int p = 1; p <= m; p++) { System.out.print((char) (alpha + p - 1) + " "); } System.out.println(); } for (int m = 1; m <= r; m++) { for (int n = 0; n <= m; n++) { System.out.print(" "); } for (int p = 1; p <= r - m; p++) { System.out.print((char) (alpha + p - 1) + " "); } System.out.println(); } } }
A A B A B C A B C D A B C D E A B C D A B C A B A
class Pattern40 { public static void main(String args[]) { int r = 5; for (int m = 1; m <= r; m++) { for (int n = r; n > m; n--) { System.out.print(" "); } for (int p = 1; p <= (m * 2) - 1; p++) { System.out.print("*"); } System.out.println(); } for (int m = r - 1; m >= 1; m--) { for (int n = r - 1; n >= m; n--) { System.out.print(" "); } for (int p = 1; p <= (m * 2) - 1; p++) { System.out.print("*"); } System.out.println(); } } }
* *** ***** ******* ********* ******* ***** *** *
Learn All in Tamil © Designed & Developed By Tutor Joes | Privacy Policy | Terms & Conditions