Skip to content

Instantly share code, notes, and snippets.

@ovidijusr
Created March 7, 2016 08:49
Show Gist options
  • Save ovidijusr/4ce784032c6d0d8c1f2b to your computer and use it in GitHub Desktop.
Save ovidijusr/4ce784032c6d0d8c1f2b to your computer and use it in GitHub Desktop.
#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