Compare commits

..

No commits in common. "branch1" and "main" have entirely different histories.

12
1.cpp
View File

@ -1,11 +1 @@
#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;
}
include