Compare commits

...

5 Commits

Author SHA1 Message Date
4bbd676861 Merge pull request 'comm22' (#3) from vetka2 into main
Reviewed-on: #3
2024-12-16 09:05:34 +04:00
753015e21e commmmmm1 2024-12-16 09:05:24 +04:00
68cc943dbf Merge pull request 'comm11' (#2) from vetka1 into main
Reviewed-on: #2
2024-12-16 09:01:19 +04:00
43e71b4b0a comm22 2024-12-16 09:00:41 +04:00
dd9538ff4c comm11 2024-12-16 08:59:26 +04:00

View File

@ -0,0 +1,22 @@
#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 <iostream>
int sum(int a, int b) {
return a + b;
}
int main() {
int x, y;
std::cout << "Enter two numbers: ";
std::cin >> x >> y;
std::cout << "Sum: " << sum(x, y) << std::endl;
return 0;
}