Compare commits

...

4 Commits

Author SHA1 Message Date
40bddb5753 Merge pull request 'cv' (#2) from branch2 into main
Reviewed-on: #2
2024-12-16 09:18:21 +04:00
Honor
3af26b39ed cv 2024-12-16 09:18:15 +04:00
083e24e39d Merge pull request 'cv' (#1) from branch1 into main
Reviewed-on: #1
2024-12-16 09:15:02 +04:00
Honor
f2b13497d3 cv 2024-12-16 09:14:42 +04:00

12
1.cpp
View File

@ -1,11 +1,11 @@
#include <iostream> #include <iostream>
int factorial(int n) { int sum(int a, int b) {
return (n == 1 || n == 0) ? 1 : n * factorial(n - 1); return a + b;
} }
int main() { int main() {
int num; int x, y;
std::cout << "Enter a number: "; std::cout << "Enter two numbers: ";
std::cin >> num; std::cin >> x >> y;
std::cout << "Factorial: " << factorial(num) << std::endl; std::cout << "Sum: " << sum(x, y) << std::endl;
return 0; return 0;
} }