C++ Program To Print Pyramid Patterns – GeeksforGeeks
In this article, we will discuss the following top pattern programs in C++ star *, numbers, or other characters.
Pyramid Patterns in C++
- Simple Pyramid Pattern
- Simple Pyramid Pattern after 180° Rotation
- Inverted Pyramid Pattern
- Inverted Pyramid Pattern after 180° Rotation
- Triangle Pattern
- Inverted Triangle Pattern
- Number Pyramid Pattern
- Numbers Pyramid Pattern without Reassigning
- Continuous Number Pyramid Pattern after 180° Rotation
- Palindrome Triangle Pattern
- Alphabet Pyramid Pattern
- Continuous Alphabet Pyramid Pattern
C++ Programs to Print Patterns and Pyramids
1. Simple Pyramid Pattern in C++
Method 1: Printing simple pyramid pattern using for loop
C++
|
Output
* * * * * * * * * * * * * * *
Method 2: Printing the above pattern using while Loop
C++
|
Output
* * * * * * * * * * * * * * *
Method 3: Printing the above pattern using recursion.
C++
|
Output
* * * * * * * * * * * * * * *
2. Simple Pyramid Pattern in C++ after 180° Rotation
Method 1: Printing the 180° rotated simple pyramid pattern using for loop.
C++
|
Output
* * * * * * * * * * * * * * *
Method 2: Printing the above pattern using while loop.
C++
|
Output
* * * * * * * * * * * * * * *
3. Inverted Pyramid Pattern in C++
Method 1: Printing the pattern using for loop.
C++
|
Output
* * * * * * * * * * * * * * *
Method 2: Printing the pattern using while loop.
C++
|
Output
* * * * * * * * * * * * * * *
Method 3: Printing the above pattern using recursion.
C++
|
Output
* * * * * * * * * * * * * * *
4. Inverted Pyramid Pattern in C++ after 180° Rotation
Method 1: Printing this pattern using for loop.
C++
|
Output
* * * * * * * * * * * * * * *
Method 2: Printing the above pattern using while loop.
C++
|
Output
* * * * * * * * * * * * * * *
5. Triangle Pattern in C++
Method 1: Printing the given pattern using for loop.
C++
|
Output
* * * * * * * * * * * * * * *
Method 2: Printing the above pattern using while loop.
C++
|
Output
* * * * * * * * * * * * * * *
6. Inverted Triangle Pattern in C++
Method 1: Printing the inverted triangle pattern using for loop.
C++
|
Output
* * * * * * * * * * * * * * * * * * * * * * * * *
Method 2: Printing the above pattern using while loop.
C++
|
Output
* * * * * * * * * * * * * * * * * * * * * * * * *
6. Number Pyramid Pattern in C++
Method 1: Printing the number pyramid pattern using for loop.
C++
|
Output
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
Method 2: Printing the above pattern using while loop.
C++
|
Output
1 2 2 3 3 3 4 4 4 4 5 5 5 5 5
7. Numbers Pyramid Pattern in C++ without Reassigning
Method 1: Printing the number pyramid pattern in C++ without reassigning using for loop.
C++
|
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Method 2: Printing the above pattern using while loop.
C++
|
Output
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
8. Continuous Number Pyramid in C++ after 180° Rotation
C++
|
Output
1 2 3 3 4 5 4 5 6 7 5 6 7 8 9
9. Palindrome Triangle Pattern in C++
C++
|
Output
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
10. Alphabet Pyramid Pattern in C++
Method 1: Printing the given pattern using for loop.
C++
|
Output
A B B C C C D D D D E E E E E
Method 2: Printing the above pattern using while loop.
C++
|
Output
A B B C C C D D D D E E E E E
11. Continuous Alphabet Pyramid Pattern in C++
Method 1: Printing the above pattern using for loop.
C++
|
Output
A B C D E F G H I J K L M N O
Method 2: Printing the above pattern using while loop.
C++
|
Output
A B C D E F G H I J K L M N O
Printing patterns in python language are discussed in the following article – Programs for printing pyramid patterns in Python
This article is contributed by Manjeet Singh(S.Nandini). If you like GeeksforGeeks and would like to contribute, you can also write an article using write.geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or if you want to share more information about the topic discussed above.
Stay connected with us on social media platform for instant update click here to join our Twitter, & Facebook We are now on Telegram. Click here to join our channel (@TechiUpdate) and stay updated with the latest Technology headlines. For all the latest Technology News Click Here
Denial of responsibility! FineRadar is an automatic aggregator around the global media. All the content are available free on Internet. We have just arranged it in one platform for educational purpose only. In each content, the hyperlink to the primary source is specified. All trademarks belong to their rightful owners, all materials to their authors. If you are the owner of the content and do not want us to publish your materials on our website, please contact us by email – [email protected]. The content will be deleted within 24 hours.