---
# System prepended metadata

title: 'Multiplication table [6 kyu]'
tags: [C++, CodeWars]

---

# Multiplication table [6 kyu]

[Multiplication table](https://www.codewars.com/kata/534d2f5b5371ecf8d2000a08)
6 kyu

```cpp=
/**
*** Author: R-CO
*** E-Mail: daniel1820kobe@gmail.com
*** Date: 2020-09-25
**/
#include <vector>
using std::vector;

vector<vector<int>> multiplication_table(int n){
  vector<vector<int>> output_table;
  
  for (int i = 1; i <= n; ++i) {
    output_table.push_back({i});
    for (int j = 2; j <= n; ++j) {
      output_table[i-1].push_back(output_table[i-1][0] * j);
    }
  }
  
  return output_table;
}

```

## Result
![](https://i.imgur.com/ou2ZzKL.png)


###### tags: `CodeWars` `C++`
