> For the complete documentation index, see [llms.txt](https://v-vishwanath.gitbook.io/kiraak/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://v-vishwanath.gitbook.io/kiraak/examples/pyramid-printing.md).

# Pyramid Printing

Iss example ke liye aise ek code likhna hai jo number of rows leta, aur utte rows ka ek star symbol vala pyramid bana daalta! Ab pehle number, number of test cases hoga, yaani utte inputs aate, aur har input ka pyramid banake dikhaneka hai!

Example:

{% code title="input" %}

```
3
2
5
4
```

{% endcode %}

{% code title="output" %}

```
 *
**

    *
   **
  ***
 ****
*****

   *
  **
 ***
****
```

{% endcode %}

Ye code bahut simple hai! Bas apna logic banalo baaki ka Kiraak dekh lega!

```
printPyramid function boletoh nRows lega aur {
    ab i ko 1 se nRows tak chalate hue {
        screen pe " " * (nRows - i) dikha
        screen pe "*" * i dikha
        screen pe '\n' dikha
    }
}

testCases me input se number aata
ab i ko 1 se testCases tak chalate hue {
    n me input aata
    printPyramid ko n deke chala
    
    screen pe '\n' dikha
}

```
