> For the complete documentation index, see [llms.txt](https://math-5.gitbook.io/math/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://math-5.gitbook.io/math/reference/mathematical-operations/pascal.md).

# pascal

## Compute the nth row of the pascal triangle

```cpp
vector<int>pascal(n);
```

will return the nth row of the pascal triangle, stored in a vector of integers. See below example:

```cpp
vector<int> test = pascal(3);
for(auto i : test){
    cout << i;
}
//Code above returns: 121
```

<figure><img src="/files/KtqDr5UJGyfsW3Mniuvr" alt=""><figcaption><p>Pascal triangle</p></figcaption></figure>
