summaryrefslogtreecommitdiff
path: root/factorial.hpp
blob: ddc0bacc9ba0ab04d28335fc2a2be11b2437f499 (plain)
1
2
3
4
5
6
7
8
9
#pragma once

long unsigned factorial(unsigned p) {
  if (p == 0) {
    return 1;
  } else {
    return p * factorial(p - 1);
  }
}