> 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="https://3716279422-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTWIbJlMpBp8XirWQ43ll%2Fuploads%2FUMPx65HoKBQK0LjPz54N%2FPascals%2Btriangle-1735830495.jpg?alt=media&amp;token=766af9d9-3fec-4e09-a24c-aab92aca90ac" alt=""><figcaption><p>Pascal triangle</p></figcaption></figure>
