fork download
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6. int rows;
  7. cout << "Enter the number of rows for the Full Pyramid Pattern: ";
  8. cin >> rows;
  9.  
  10. for (int i = 1; i <= rows; ++i) {
  11. // Print spaces
  12. for (int j = 1; j <= rows - i; ++j) {
  13. cout << " ";
  14. }
  15. // Print stars
  16. for (int k = 1; k <= 2 * i - 1; ++k) {
  17. cout << "*";
  18. }
  19. cout << endl;
  20. }
  21.  
  22. return 0;
  23. }
  24.  
Success #stdin #stdout 0.01s 5268KB
stdin
10
stdout
Enter the number of rows for the Full Pyramid Pattern:          *
        ***
       *****
      *******
     *********
    ***********
   *************
  ***************
 *****************
*******************