axs
This commit is contained in:
commit
3e70056b86
11
1.c
11
1.c
@ -1,4 +1,15 @@
|
|||||||
#include <iostream>
|
#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) {
|
int sum(int a, int b) {
|
||||||
return a + b;
|
return a + b;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user