Skip to content

Instantly share code, notes, and snippets.

@rahman541
Created January 20, 2019 08:14
Show Gist options
  • Save rahman541/03f2d751543bf8ab86bd6438c5a675c0 to your computer and use it in GitHub Desktop.
Save rahman541/03f2d751543bf8ab86bd6438c5a675c0 to your computer and use it in GitHub Desktop.
Factorial finder in C++
#include <iostream>
using namespace std;
int factorialFinder(int x) {
if (x == 1) return 1;
return x * factorialFinder(x-1);
}
int main() {
cout << factorialFinder(5) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment