Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- cout << "Hello world!" << endl;
- return 0;
- }
- int Factorial(int n)
- {
- if (n==0) // base case
- return 1;
- else
- return n * Factorial(n-1);
- }
- int my_recursive_function (int x)
- {
- if (x==1):
- my_recursive_function (x) = 1;
- else if (x >1):
- my_recursive_function(x) = x + my_recursive_function (x-1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement