Compare commits

...

2 Commits

Author SHA1 Message Date
ea2b1f6376 ввв 2024-12-16 08:46:49 +04:00
5a420b138f om1 2024-12-16 08:46:04 +04:00

View File

@ -0,0 +1,12 @@
#include <iostream>
int factorial(int n) {
return (n == 1 || n == 0) ? 1 : n * factorial(n - 1);
}
int main() {
int num;
std::cout << "Enter a number: ";
std::cin >> num;
std::cout << "Factorial: " << factorial(num) << std::endl;
return 0;
}
öóêöóê