Program code: #include<iostream> using namespace std; void display(int n) { int space = n / 2, num= 1; for (int…