VOOZH about

URL: https://www.geeksforgeeks.org/c/c-program-for-printing-180-degree-rotation-of-simple-half-left-pyramid/

⇱ C Program For Printing 180 Degree Rotation of Simple Half Left Pyramid - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

C Program For Printing 180 Degree Rotation of Simple Half Left Pyramid

Last Updated : 30 Dec, 2024

The 180° Rotation of a Simple Half Left Pyramid is a pattern where the base of the pyramid is aligned with the bottom, and the entire structure appears rotated by 180°. The resulting structure is nothing but inverted right half pyramid. In this article, we will learn how to print the 180° Rotated Half Left Pyramid using a C program.

👁 180-rotated-left-half-pyramid


Output

* * * * * | 1 2 3 4 5 | A B C D E 
* * * * | 1 2 3 4 | A B C D
* * * | 1 2 3 | A B C
* * | 1 2 | A B
* | 1 | A

Explanation:

  • The outer loop runs from i = 1 to i = n printing the rows of the pyramid.
  • For the current row i, the number of stars is n - i, where n is the total number of rows. It is printed by inner loop.
Comment
Article Tags: