The program to print palindrome pyramid patterns using numbers is discussed here. Given a number n, the task is to print a palindrome pyramid containing n number of rows.
Input:
5 (number of rows)
Output:
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
@@coding::1@@
Input:
5 (number of rows)
Output:
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
@@coding::2@@
Input:
5(number of rows)
Output:
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
@@coding::3@@
Input:
7
Output:
*******1********
*******2*2*******
******3*3*3******
*****4*4*4*4*****
****5*5*5*5*5****
***6*6*6*6*6*6***
@@coding::4@@
Recommended Programs