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) diff --git a/math/power_for_huge_numbers.cpp b/math/power_for_huge_numbers.cpp index 5cb1ae514..301767d66 100644 --- a/math/power_for_huge_numbers.cpp +++ b/math/power_for_huge_numbers.cpp @@ -81,10 +81,10 @@ void power(int x, int n) { /** Main function */ int main() { int exponent, base; - printf("Enter base "); - scanf("%id \n", &base); - printf("Enter exponent "); - scanf("%id", &exponent); + std::cout << "Enter base "; + std::cin >> base; + std::cout << "Enter exponent "; + std::cin >> exponent; power(base, exponent); return 0; }