| Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 1 | #include <sample.h> |
| 2 | |||||
| 3 | int Factorial(int n) | ||||
| 4 | { | ||||
| 5 | int result = 1; | ||||
| Patrick Venture | 0b02be9 | 2018-08-31 11:55:55 -0700 | [diff] [blame] | 6 | for (int i = 1; i <= n; i++) |
| Matthew Barth | 00b1e5b | 2016-09-09 12:15:46 -0500 | [diff] [blame] | 7 | { |
| 8 | result *= i; | ||||
| 9 | } | ||||
| 10 | return result; | ||||
| 11 | } | ||||