Explore
ProGrad Programs
About Us

Edit
Reply




Edit

Pyramid pattern printing using numbers or Pyramid number patterns | FACE Prep

Published on 10 Mar 2020

Program to print pyramid pattern printing using numbers or Pyramid number patterns is discussed here. Given a number n, the various patterns of pyramids using numbers are produced as output.


Half pyramid pattern using numbers


1
1 2
1 2 3
1 2 3 4
1 2 3 4 5


Program to print half pyramid pattern using numbers


C
C++
Java
Python 3

Output
5
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5


Inverted half pyramid pattern using numbers


1 2 3 4 5
1 2 3 4
1 2 3 
1 2
1


Program to print inverted half pyramid pattern printing using numbers


C
C++
Java
Python 3

Output
5
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1


Full pyramid pattern using numbers


        1
      2 3 2
    3 4 5 4 3
  4 5 6 7 6 5 4
 5 6 7 8 9 8 7 6 5


Program to print full pyramid using numbers


C
C++
Java
Python 3

Output
4
   1
  2 3 2
 3 4 5 4 3
4 5 6 7 6 5 4


Hollow half pyramid pattern using numbers


1
1 2
1   3
1     4
1 2 3 4 5


Program to print hollow half pyramid pattern using numbers


C
C++
Java
Python 3

Output
5
1
1 2
1   3
1    4
1 2 3 4 5


Hollow Inverted Half Pyramid Pattern using numbers


1 2 3 4 5
2     5
3   5
4 5
5


Program to print hollow inverted half pyramid pattern using numbers


C
C++
Java
Python 3

Output
5
1 2 3 4 5
2    5
3   5
4 5
5


Hollow Full Pyramid Pattern using numbers


   1
  1 2
 1   3
1 2 3 4


Program to print hollow full pyramid pattern using numbers


C
C++
Java

Output
4
   1
  1 2
 1   3
1 2 3 4


Recommended Programs






If you have any feedback about this article and want to improve this, please write to enquiry@faceprep.in