Created
March 7, 2016 08:49
-
-
Save ovidijusr/4ce784032c6d0d8c1f2b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <cstdlib> | |
using namespace std; | |
long function(int variable, int target) | |
{ | |
if (variable == 0 || variable == 1) { | |
return 1; | |
} | |
else { | |
return function(variable-1, 0) * variable; | |
} | |
} | |
int main() | |
{ | |
cout << function(5,0); | |
system("pause"); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment