From e52da1db6ea46fac9f68ae8b492fbbb6a87b5190 Mon Sep 17 00:00:00 2001 From: Krishna Vedala Date: Thu, 28 May 2020 16:40:08 -0400 Subject: [PATCH] documented factorial --- math/factorial.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/math/factorial.cpp b/math/factorial.cpp index 8b13eb52d..353f0b16b 100644 --- a/math/factorial.cpp +++ b/math/factorial.cpp @@ -1,14 +1,17 @@ -// C++ program to find factorial of given number -#include +/** + * @file + * @brief C++ program to find factorial of given number + */ +#include -// function to find factorial of given number +/** function to find factorial of given number */ unsigned int factorial(unsigned int n) { if (n == 0) return 1; return n * factorial(n - 1); } -// Driver code +/** Main function */ int main() { int num = 5; std::cout << "Factorial of " << num << " is " << factorial(num)